Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Navigation

    Cloudron Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular

    I want to create an app that turns an email into a web hook

    App Packaging & Development
    4
    12
    65
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Lonk
      Lonk last edited by

      Any ideas on where I should start? My first thought was to base it on this project: https://github.com/heaptracetechnology/gmail

      Note: Zapier can already do this quite well but is limited to how many emails can be received and I'm not quite sure if it's real time or if it's polled on their platform, but I want this to be as real time as possible.

      Lonk 1 Reply Last reply Reply Quote 0
      • Lonk
        Lonk @Lonk last edited by Lonk

        This also looks promising: https://github.com/huan/docker-simple-mail-forwarder and it isn't locked into Gmail's API (and would still be instantaneous-is).

        I'm also considering AWS SES (Incoming) to parse to a AWS LAMBDA script if I can't make something work on Cloudron, but I'd prefer to build and run this on Clourdon.

        Which of these three directions would you go?

        marcusquinn 1 Reply Last reply Reply Quote 0
        • marcusquinn
          marcusquinn @Lonk last edited by

          @lonk Try EspoCRM?

          Lonk 1 Reply Last reply Reply Quote 0
          • Lonk
            Lonk @marcusquinn last edited by

            @marcusquinn said in I want to create an app that turns an email into a web hook:

            EspoCRM

            Just tried it out: https://demo.espocrm.com/?lang=en_US#EmailFilter/create

            That comes close, but just forwards an email to another email. I'm trying to convert can email to then parse it into a web hook.

            marcusquinn 1 Reply Last reply Reply Quote 0
            • marcusquinn
              marcusquinn @Lonk last edited by

              @lonk Not sure, it connects to emails, has mail filters and events, and has webhooks (... Administration).

              Maybe Integromat would give a quick & dirty fix?

              Otherwise maybe it's app packaging the above for you 🙂

              jimcavoli Lonk 2 Replies Last reply Reply Quote 0
              • jimcavoli
                jimcavoli App Dev @marcusquinn last edited by

                So I've basically done this inside the packaging for Loomio by polling the recvmail IMAP box for the app (see https://git.cloudron.io/jimcavoli/loomio-app/-/blob/master/pkg/imap_poller/loomio_relay.rb for code - in ruby because that's what I do most 🙂 ). The issue over there is that recvmail isn't playing nicely with simultaneous sendmail right now. The upstream docker-compose arrangement uses the (somewhat long-unmaintained by all appearances) mailin package (npm) at https://github.com/Flolagale/mailin. There are some other free services online that seem to do this, but most mail relays a la SendGrid, Postmark, etc. also do this as an option as well. There's many ways to approach it - yet another is that once n8n becomes available, it can also do this with its EmailReadImap and HTTP Request components. That is just still waiting for good enough proxyAuth support to make it not a complete vulnerability to deploy.

                Lonk 1 Reply Last reply Reply Quote 2
                • Lonk
                  Lonk @marcusquinn last edited by Lonk

                  @marcusquinn said in I want to create an app that turns an email into a web hook:

                  Integromat

                  Integromat was almost EXACTLY what I needed, but it ended up polling every 15 minutes and the web hooks I need to create need to be triggered, coincidentally, before exactly 15 minutes since the code in these emails expire (which makes Integromat not a guarantee of a successful non-expired email).

                  1 Reply Last reply Reply Quote 1
                  • Lonk
                    Lonk @jimcavoli last edited by Lonk

                    @jimcavoli said in I want to create an app that turns an email into a web hook:

                    n8n

                    Do any of the solutions you mentioned allow for instant trigger (email received) -> action (webhooks fired)?

                    I have no need of sending mail, just receiving it, and parsing the sender,recipient,subject, and text_body into a custom webhook that POSTS those values. I'll check out n8n!

                    jimcavoli 1 Reply Last reply Reply Quote 1
                    • jimcavoli
                      jimcavoli App Dev @Lonk last edited by

                      @lonk Pretty much either of them, to my understanding, save my custom ruby code. That's polled at whatever frequency by the scheduler.

                      Lonk 1 Reply Last reply Reply Quote 0
                      • Lonk
                        Lonk @jimcavoli last edited by

                        @jimcavoli I'm leaning towards using Amazon SES Incoming -> AWS LAMBDA Script -> web hook with from, recipient, subject, and text_content in the POST.

                        It sounds like the simplest option for me at this point, just gotta check what AWS charges (even though I'd rather not use LAMBDA, it's a weird language).

                        T jimcavoli 2 Replies Last reply Reply Quote 1
                        • T
                          thetomester13 App Dev @Lonk last edited by

                          @lonk I'm hoping to get something like this set up soon as well. n8n looks like a great option, so am waiting on proxyAuth and then the packaged app. Like you, I realized that aren't too many great out of the box solutions for this yet.

                          1 Reply Last reply Reply Quote 0
                          • jimcavoli
                            jimcavoli App Dev @Lonk last edited by

                            @lonk That's a totally valid, effective way to do it. Probably the most instantaneous of all the things mentioned, since it seems speed/latency is a priority for you. Lambda's not that bad to write code for - if you get pretty advanced with it, you can really run nearly any language on the platform, though the officially supported Java, Go, PowerShell, Node.js, C#, Python, and Ruby are the easiest options. You've got a lot of choices there.

                            1 Reply Last reply Reply Quote 0
                            • First post
                              Last post