• Dev
  • Blomstra Email Conversations: post via email to your Flarum forum

We're currently developing a solution to add the ability to start new discussions and reply to them via email. Want to respond by email to a notification? No problem, that's covered too.

Commissioned by a Blomstra client, with the specific request to build this feature for the benefit of the whole Flarum community, we're ready to now offer this extension as a public beta to anyone who'd like to help test, offer feature suggestions, etc.

Features
  • Allow users to register (and confirm) additional email addresses that can be associated with their account
  • Start new discussions via email
  • Reply to notification emails
  • HTML formatted emails are converted to Markdown and formatted according to the current TextFormatter configuration
  • Specify a Tag for new discussions started by email
  • Option to have new discussions started via email automatically flagged for moderator approval/tag re-assignment, etc
  • Option to auto subscribe to discussions participated in via email
What do I need to know?

At present, you must be using Mailgun to send your email notifications (using the built in Mailgun provider). Support for other services might be added in the future, but for now this will be the only provider option.

If you're also using fof/pretty-mail, this is supported, but you are required to make minor updates to your templates.

Your email sending domain DNS must have the correct MX records configured for Mailgun to be able to receive inbound mail. Don't worry about configuring routes, etc, as the extension will configure this for you.

Installation

We've seperated logic into two extensions: blomstra/conversations and blomstra/email-conversations. This is so that we can support other conversation types in the future (think Discord, Slack, etc) that can also potentially post to the forum and receive notifications.

composer require blomstra/email-conversations:@beta

blomstra/conversations and blomstra/email-conversations will be installed together.

  • Enable Conversations first, and review the permissions to see the post source. By default this is set to admin and mod groups.
  • Enable Email Conversations.
  • Visit {YOUR_FORUM}/admin#/mail and click Create Mailgun incoming route.
  • Configure the extension settings as per your requirements {YOUR_FORUM}/admin#/extension/blomstra-email-conversations.
  • If you're using fof/pretty-mail: In each of your HTML templates, add the variable $notificationId somewhere in the content. Somewhere in the <footer> element is recommended.
  • Send a test email to your forum (The email address is the one configured in your email settings tab). The subject line will become the discussion title, the email body will become the post content.
Screenshots

Admin panel
Admin panel settings

Post header
Post header

Post header for moderators
Post header for moderators

Additional email addresses in user settings
Additional email addresses in user settings

Feedback

We 💗 your feedback. Any issues/bugs should be reported on Github, please, so that we can keep track of everything in one place. General comments and suggestions are most welcome here in this discussion

    That’s an awesome extension. Makes me think that it could replace Zammad as a Helpdesk 🙂 But need to look into Mailgun - that’s of course a big limiting factor.

    Wow, that's pretty darn cool! Glad to see something like this come to fruition for flarum that will also be offered to the community. Great job by the Blomstra team and special thanks for the client for commissioning.

    We'd love to leverage something like this but would need a self-hosted option, so I am hopeful some of the other mail options make its way in at some point. Also excited to see what comes from the other integration points, namely slack 😃

      ctml Slack is currently being worked on already for the same client. If I'm not mistaken they favor open sourcing that too! They, however, prefer it to be build against the new beta API, you get request access here: https://slack.com/platform-beta

      As for alternative mail adapters; they'd need to be able to receive email. A raw IMAP option might be possible but would either be commissioned or contributed. We gladly assist with either of those.

        luceos A raw IMAP option might be possible but would either be commissioned or contributed.

        How many working hours it may take?

        I think users can start a discussion using WhatsApp, we can relay on API providers like twillo or kaleyra
        A user sends a "hi" message to a WhatsApp number > selects options > starts a discussion... this will be an expensive API call for every API request WhatsApp charges around 0.013x4

        the possibilities are endless, we can also integrate this extension with IFTTT
        using the android app of IFTTT we can create something like if someone sends us an SMS we can start a discussion
        if someone tweets something we can start a discussion

        2 months later

        Any ideas?

        Problem 1
        - Root composer.json requires blomstra/email-conversations *, found blomstra/email-conversations[dev-master, 0.1.0-beta.1, 0.1.0-beta.2, 0.1.0-beta.3, 0.1.0-beta.4] but it does not match your minimum-stability.

        Using php 8.1.

          majkimajki you need to install @beta and not * as a version constrain - as stated in the initial post.

            GreXXL

            OK, thanks.

            But I'm getting:

            Your requirements could not be resolved to an installable set of packages.

            Problem 1
            - Root composer.json requires blomstra/email-conversations @beta -> satisfiable by blomstra/email-conversations[0.1.0-beta.1, 0.1.0-beta.2, 0.1.0-beta.3, 0.1.0-beta.4].
            - blomstra/email-conversations[0.1.0-beta.1, ..., 0.1.0-beta.4] require php 8.0 -> your php version (7.3.33) does not satisfy that requirement.

            Installation failed, reverting ./composer.json and ./composer.lock to their original content.

            [hempinve@s47 tajemnicenatury]$ php --version
            PHP 8.1.8 (cli) (built: Jul 14 2022 10:33:21) (NTS)

            Which is quite weird to be honest, as I'm using 8., and flarum dashboard also confirms the php version.

            Any ideas?

              majkimajki guess that you are using a different version for cli then you are using for the actual hosting. You would need to check your hosting settings.

                GreXXL

                Still no luck, any ideas?

                Your requirements could not be resolved to an installable set of packages.

                Problem 1
                - Root composer.json requires blomstra/email-conversations @beta -> satisfiable by blomstra/email-conversations[0.1.0-beta.1, 0.1.0-beta.2, 0.1.0-beta.3, 0.1.0-beta.4].
                - blomstra/email-conversations[0.1.0-beta.1, ..., 0.1.0-beta.4] require blomstra/conversations @beta -> found blomstra/conversations[dev-master, 0.1.0-beta.1, 0.1.0-beta.2] but it does not match your minimum-stability.

                Installation failed, reverting ./composer.json and ./composer.lock to their original content.

                  composer config minimum-stability beta
                  composer config prefer-stable true
                  composer require blomstra/email-conversations:"*@beta"

                  That should allow beta's to be installed while still forcing stable packages for everything else.

                  Hi,

                  I've managed to work everything out, but I cannot find anything in the logs.

                  After sending an email to the verified address no new disscusion is made.

                  Any tips?

                  • IanM replied to this.

                    majkimajki do you see the configured incoming route in the mail section of the admin panel, or is it prompting to set one up? {FORUM_URL}/admin#/mail

                      IanM

                      Hi, mailgun gives me: "event": "stored" in the emails it receives.

                      As for your questions I clicked the button to generate, now I have:

                      Incoming Mailgun route
                      6........................d - Blomstra Email Conversations incoming route

                      • IanM replied to this.

                        majkimajki excellent, try sending a mail to the forum now that the route is fully setup - do you see a new discussion now?

                          IanM

                          No. No new disscusions appear.

                          I've used; Additional email addresses, and verified this address, and also tried sending from a different one.

                          • IanM replied to this.

                            majkimajki Additional email addresses is not something that has been tested with this feature just yet, so I'm not sure if that will function correctly or not.

                            The outgoing email address as configured already in Flarum is used to setup the incoming route when the Generate button is clicked. Can you try sending a mail to that address to see if that works for you?