4 days later

Version 1.1.1

  • Fix compatibility with Flarum 1.5+
  • Fix errors if extensions call the Pretty Mail extender on PHP versions below 8.0
    21 days later

    Hi Clark, great extension! I'm having a problem sporadically when making a post, getting the 'Oops' message in Flarum. The post does still post correctly, but the reply window stays open as though it hasn't posted.

    At the same time that this happens, I get an error in the log:

    flarum.ERROR: Exception: Error: Call to undefined method Illuminate\Container\Container::url() in /home/sites/4b/9/9d43d8391c/public_html/forum/public/vendor/fof/pretty-mail/src/BladeCompiler.php(28) : eval()'d code:50

    Any suggestions would be very helpful - this has been happening since at least v1.3 for me.]

    Thanks

    2 months later

    Can this extension be used to customize the email templates while keeping them as plain text messages? I hate HTML in emails with a passion so I would really like to avoid it at all cost.

    This extension seems to be dedicated to HTML but as @clarkwinkelmann said in this thread that:

    even if you are not using the Pretty Mail extension, you will probably have to re-use/re-implement most of the exact same code that can be found in that extension.

    it would be really cool if it allowed plain text templates too 😃

      3 months later

      n-peugnet

      If plain text is what you need, I believe you could use FOF-linguist to edit the translation strings.

      I'm curious: if a user gives me an @mention in a discussion thread I'm already following, I get the email notification tied to Flarum/subscriptions New Post Email, and not the one for Flarum/mentions User Mentioned Email.

      I would think that getting a direct mention trumps the general "there's yet another message in a discussion you follow", in favor of the more targeted "Someone messaged you directly, you should check it out..."

      Is this expected behavior? Is there some config I can tune to define what event "wins" over another?

      When sending the new post email, is there a way to conditionally show the following text based on the user's preferences:

      You won't receive any more notifications about this discussion until you're up-to-date.

      With the default template, the text is shown even if the user's settings are set to Notify about every new post instead of only the last in a discussion.

      Thanks!

      a year later

      Now that flarum core supports group mentions, I noticed the email format is not formatting properly and is just one long string of plain text (but still contains my custom html header/footer) while new emails triggered via tag following do format properly and consist of formatted code blocks, headers, etc. Also, I see user notifications have their own template defined in fof/prettymail while group mentions do not which may be another slight difference.

      Any idea why there would be a difference in the email formatting between the group mentions & tag subscriptions? I suspect both group mentions, and tag subscriptions both use the default template so I would expect HTML formatting to work the same?

      I see here in the linked code @IanM that the post would appear to be formatted, but this is also in the 2.x branch so I am wondering if it's missing in 1.X or just located in a different area and I'm hitting a different issue?
      {!! $blueprint->post->formatContent() !!}
      flarum/frameworkblob/2.x/extensions/mentions/views/emails/html/groupMentioned.blade.php

      Edit :

      Now that I think about it, I checked an older @group mention email from a few months back and it was formatted properly. My fof/prettymail templates never changed, maybe just minor flarum upgrades since then.

      Are there any conditions where if formatting fails it will fallback to plaintext? And anyway I could debug that, the emails triggered via Queue were all successful and I don't see any flarum logs today in storage/logs that could highlight any errors.

      Both emails have code blocks, headers, links, emojis... the only difference may be inclusion of some embedded images in the email and also a table in the email which formatting did not work.

      Update:

      Found part of the problem.

      Works

       Authorization: Bearer token

      Doesnt work - Breaks email formatting (ie. <> are bad)

       Authorization: Bearer <token>

      When I added the rest of my post content back and triggered, it broke again. I went through the same process and discovered this time it was the markdown tables breaking it. I can work around both of these, though tables in emails would be especially nice to have to keep things neat and tidy. Since this is an external extension providing the tables, does that mean it would probably not be possible to have formatted in emails?

      https://discuss.flarum.org/d/26456-markdown-tables

      On the topic of group mentions, it would be nice to have a custom email template like other supported templates, and also customize the subject line.

      • ctml replied to this.
        3 months later

        PHP Notice: file_get_contents(): Read of 12288 bytes failed with errno=21 Is a directory in /www/wwwroot/flarum/vendor/fof/pretty-mail/src/Overrides/NotificationMailer.php on line 87

        a month later

        Just wondering if it is possible to adapt the template in the configuration so that I only send out the first 3 lines or the first 250 characters of the post? I can see the script in the template:

            <div class="post-content">
                {!! $blueprint->post->formatContent() !!}
            </div>

        So I figure there may be some functionality that I can just adapt it with?

        15 days later

        It would be great if @mentions for groups and users are sanitized/formatted differently for email content. I think removing the #id link, or making the display format optional in the extension settings would be a big improvement.

        In my opinion the last of each looks the best.

        @"Group Name"#g27  <- current
        @"Group Name"      <- better
        @Group Name        <- best
        Group Name (if display format of group/user mentions via extension setting were an option, this could be another)
        
        @"User"#8712       <- current
        @"User"            <- better
        @User              <- best 
        User (if display format of group/user mentions via extension setting were an option, this could be another)

        I sometimes get users not knowing what the hash tags/numbers mean are a little confused until I explain, they even thought I accidentally sent an email with a password embedded 😆 . Obviously for the admins of the forum we know what the format means but end users are not always as savvy. I think the additional information about users/groups aren't necessary for email purposes so it would be great to make it optional or remove it altogether 🙏

          What language is this code? I need to have a go at editing it myself:

          <div class="post-content">
          {!! $blueprint->post->formatContent() !!}
          </div>

            adam42

            {!! $blueprint->post->formatContent() !!}

            This is a template variable, which you cannot and should not edit. You do need to place it correctly within the other markup.

            The rest is HTML. If you start editing, make sure to also look at HTML rules for emails, as this is quite a hard thing to master and it can cause weird glitching markup across different email providers and mail clients.

            ctml I find the issue you describe particularly inconvenient because I use Zapier to forward notification emails to Telegram and Telegram translates them into @“[deleted]”#41 which makes the instant message look outright weird.

            4 months later

            Does anyone know if this extension uses the display name (Nickname) instead of the username?

            a month later

            ctml

            a follow up to this issue reported. perhaps this happens because the characters need to be converted for HTML purposes. < would be an opening for an HTML tag, which should probably be translated to &lt?

            The odd thing is it's not consistent across the emails generated from prettymail, some templates work while others don't.

            • new discussion ❌ broken
            • group mentions ❌ broken
            • user mentions ✅ works

            You can try it yourself by generating an email, and including < in the post content and will fail to translate the content of the post to rich HTML, and falls back to a long string of text embedded inside the HTML email.

            16 days later

            After flarum changed its domain name, new registered members did not receive the verification email!