Skip to content

Instantly share code, notes, and snippets.

@jonfuller
Created April 11, 2018 00:54
Show Gist options
  • Select an option

  • Save jonfuller/a3ca1d4410dc981c74d55559498619b6 to your computer and use it in GitHub Desktop.

Select an option

Save jonfuller/a3ca1d4410dc981c74d55559498619b6 to your computer and use it in GitHub Desktop.

Revisions

  1. jonfuller created this gist Apr 11, 2018.
    8 changes: 8 additions & 0 deletions HelpMailHandler.cs
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    // ...

    public bool CanHandle(MimeMessage message, IEnumerable<(string name, byte[] data)> attachments)
    {
    return true;
    }

    // ...
    9 changes: 9 additions & 0 deletions SettingsUpdateMailHandler.cs
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    // ...

    public bool CanHandle(MimeMessage message, IEnumerable<(string name, byte[] data)> attachments)
    {
    return message.Subject.ToLower(CultureInfo.CurrentCulture).Contains("settings")
    && attachments.Any(a => a.name.ToLower(CultureInfo.CurrentCulture).Contains("xlsx"));
    }

    // ...