Get subject of opened or clicked email in Mailgun

Multi tool use
Multi tool use












1















I've set up my Mailgun domain to track the opens and clicks of emails sent by my Laravel app.



Now I want to set up webhooks to be notified of those events.



In particular, I'd love to know the event type (e.g. open, click, failed, etc), subject, recipient email address, and ideally the body of the message (although not necessary). For 'click' events, I also want to see the URL of the link that was clicked.



I see which fields of Event data get sent by the webhook, and unlike Amazon SES, Mailgun's webhooks do not seem to include the email subject or body.



The webhook provides data like this:



"message": {
"headers": {
"message-id": "f9bxxxxx1e30e7278f5fe75f50741fb3@swift.generated"
}
}


So it seems to me that I'd somehow need to go to every place within my app that sends an email and add extra functionality to save to my own database the details of the email along with the unique Mailgun message-id of every message right after it has been sent.



Then, when receiving webhooks, I'd search my own database for the message-id and could see the subject and body that I'd stored.



This seems like a terrible hassle and poor design, especially given that other services (such as SES) would provide the email subject for me in the webhook.



Is there some easier way for me to know which emails were opened or clicked (when I receive a Mailgun webhook about an open or click event)?



(Am I misunderstanding something, or would I really need to revamp my entire app to take advantage of open tracking in Mailgun?)










share|improve this question























  • Have you gone through this? documentation.mailgun.com/en/latest/…

    – Faiz Khan
    Jan 1 at 8:33











  • You are right keeping a copy of email on your db is a terrible terrible idea.

    – Faiz Khan
    Jan 1 at 8:33











  • @FaizKhan Yes, I already spent many hours reading the docs.

    – Ryan
    Jan 1 at 14:14
















1















I've set up my Mailgun domain to track the opens and clicks of emails sent by my Laravel app.



Now I want to set up webhooks to be notified of those events.



In particular, I'd love to know the event type (e.g. open, click, failed, etc), subject, recipient email address, and ideally the body of the message (although not necessary). For 'click' events, I also want to see the URL of the link that was clicked.



I see which fields of Event data get sent by the webhook, and unlike Amazon SES, Mailgun's webhooks do not seem to include the email subject or body.



The webhook provides data like this:



"message": {
"headers": {
"message-id": "f9bxxxxx1e30e7278f5fe75f50741fb3@swift.generated"
}
}


So it seems to me that I'd somehow need to go to every place within my app that sends an email and add extra functionality to save to my own database the details of the email along with the unique Mailgun message-id of every message right after it has been sent.



Then, when receiving webhooks, I'd search my own database for the message-id and could see the subject and body that I'd stored.



This seems like a terrible hassle and poor design, especially given that other services (such as SES) would provide the email subject for me in the webhook.



Is there some easier way for me to know which emails were opened or clicked (when I receive a Mailgun webhook about an open or click event)?



(Am I misunderstanding something, or would I really need to revamp my entire app to take advantage of open tracking in Mailgun?)










share|improve this question























  • Have you gone through this? documentation.mailgun.com/en/latest/…

    – Faiz Khan
    Jan 1 at 8:33











  • You are right keeping a copy of email on your db is a terrible terrible idea.

    – Faiz Khan
    Jan 1 at 8:33











  • @FaizKhan Yes, I already spent many hours reading the docs.

    – Ryan
    Jan 1 at 14:14














1












1








1








I've set up my Mailgun domain to track the opens and clicks of emails sent by my Laravel app.



Now I want to set up webhooks to be notified of those events.



In particular, I'd love to know the event type (e.g. open, click, failed, etc), subject, recipient email address, and ideally the body of the message (although not necessary). For 'click' events, I also want to see the URL of the link that was clicked.



I see which fields of Event data get sent by the webhook, and unlike Amazon SES, Mailgun's webhooks do not seem to include the email subject or body.



The webhook provides data like this:



"message": {
"headers": {
"message-id": "f9bxxxxx1e30e7278f5fe75f50741fb3@swift.generated"
}
}


So it seems to me that I'd somehow need to go to every place within my app that sends an email and add extra functionality to save to my own database the details of the email along with the unique Mailgun message-id of every message right after it has been sent.



Then, when receiving webhooks, I'd search my own database for the message-id and could see the subject and body that I'd stored.



This seems like a terrible hassle and poor design, especially given that other services (such as SES) would provide the email subject for me in the webhook.



Is there some easier way for me to know which emails were opened or clicked (when I receive a Mailgun webhook about an open or click event)?



(Am I misunderstanding something, or would I really need to revamp my entire app to take advantage of open tracking in Mailgun?)










share|improve this question














I've set up my Mailgun domain to track the opens and clicks of emails sent by my Laravel app.



Now I want to set up webhooks to be notified of those events.



In particular, I'd love to know the event type (e.g. open, click, failed, etc), subject, recipient email address, and ideally the body of the message (although not necessary). For 'click' events, I also want to see the URL of the link that was clicked.



I see which fields of Event data get sent by the webhook, and unlike Amazon SES, Mailgun's webhooks do not seem to include the email subject or body.



The webhook provides data like this:



"message": {
"headers": {
"message-id": "f9bxxxxx1e30e7278f5fe75f50741fb3@swift.generated"
}
}


So it seems to me that I'd somehow need to go to every place within my app that sends an email and add extra functionality to save to my own database the details of the email along with the unique Mailgun message-id of every message right after it has been sent.



Then, when receiving webhooks, I'd search my own database for the message-id and could see the subject and body that I'd stored.



This seems like a terrible hassle and poor design, especially given that other services (such as SES) would provide the email subject for me in the webhook.



Is there some easier way for me to know which emails were opened or clicked (when I receive a Mailgun webhook about an open or click event)?



(Am I misunderstanding something, or would I really need to revamp my entire app to take advantage of open tracking in Mailgun?)







laravel laravel-5 mailgun






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jan 1 at 4:40









RyanRyan

8,793866157




8,793866157













  • Have you gone through this? documentation.mailgun.com/en/latest/…

    – Faiz Khan
    Jan 1 at 8:33











  • You are right keeping a copy of email on your db is a terrible terrible idea.

    – Faiz Khan
    Jan 1 at 8:33











  • @FaizKhan Yes, I already spent many hours reading the docs.

    – Ryan
    Jan 1 at 14:14



















  • Have you gone through this? documentation.mailgun.com/en/latest/…

    – Faiz Khan
    Jan 1 at 8:33











  • You are right keeping a copy of email on your db is a terrible terrible idea.

    – Faiz Khan
    Jan 1 at 8:33











  • @FaizKhan Yes, I already spent many hours reading the docs.

    – Ryan
    Jan 1 at 14:14

















Have you gone through this? documentation.mailgun.com/en/latest/…

– Faiz Khan
Jan 1 at 8:33





Have you gone through this? documentation.mailgun.com/en/latest/…

– Faiz Khan
Jan 1 at 8:33













You are right keeping a copy of email on your db is a terrible terrible idea.

– Faiz Khan
Jan 1 at 8:33





You are right keeping a copy of email on your db is a terrible terrible idea.

– Faiz Khan
Jan 1 at 8:33













@FaizKhan Yes, I already spent many hours reading the docs.

– Ryan
Jan 1 at 14:14





@FaizKhan Yes, I already spent many hours reading the docs.

– Ryan
Jan 1 at 14:14












1 Answer
1






active

oldest

votes


















0














Here is the official response I received from help@mailgun.com:




Your assumption is correct, the Opened and Clicked events do not
contain the Subject line for the message that originated the tracking
event.



Currently, the Clicked and Open tracking links do not track the
Subject line for the message it is tracking. The tracking links encode
the Message-ID, Recipient, Domain, recipient variables, and other
proprietary data that link the tracking address back to your account.
Adding additional data to the tracking links would cause the link to
increase the link's length and potentially label the link as
suspicious or "spammy" by recipient spam filters.



At this time, there are no plans to change the behavior of Clicked and
Opened events, but we have a page set up to receive feedback/feature
requests at http://mailgun.uservoice.com/. Feel free to submit this
request. Other users can upvote the request, and our developers will
review the requests and take them into consideration for future
versions of our product.




This excuse of theirs is frustrating because it's a lie: the length of the URL has nothing to do with whether or not they could report the subject (and any other attribute of the email) in the webhook.



What Mailgun is expecting its users to do is exactly what Mailgun could do but chooses not to: store extra data alongside the message-id in a database and then use the message-id of the trackable link to fetch that extra data for webhook purposes.



I will switch to a provider other than Mailgun, especially now that I also learned that Hotmail, MSN, and Live.com are all rejecting my Mailgun emails.






share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53993044%2fget-subject-of-opened-or-clicked-email-in-mailgun%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    Here is the official response I received from help@mailgun.com:




    Your assumption is correct, the Opened and Clicked events do not
    contain the Subject line for the message that originated the tracking
    event.



    Currently, the Clicked and Open tracking links do not track the
    Subject line for the message it is tracking. The tracking links encode
    the Message-ID, Recipient, Domain, recipient variables, and other
    proprietary data that link the tracking address back to your account.
    Adding additional data to the tracking links would cause the link to
    increase the link's length and potentially label the link as
    suspicious or "spammy" by recipient spam filters.



    At this time, there are no plans to change the behavior of Clicked and
    Opened events, but we have a page set up to receive feedback/feature
    requests at http://mailgun.uservoice.com/. Feel free to submit this
    request. Other users can upvote the request, and our developers will
    review the requests and take them into consideration for future
    versions of our product.




    This excuse of theirs is frustrating because it's a lie: the length of the URL has nothing to do with whether or not they could report the subject (and any other attribute of the email) in the webhook.



    What Mailgun is expecting its users to do is exactly what Mailgun could do but chooses not to: store extra data alongside the message-id in a database and then use the message-id of the trackable link to fetch that extra data for webhook purposes.



    I will switch to a provider other than Mailgun, especially now that I also learned that Hotmail, MSN, and Live.com are all rejecting my Mailgun emails.






    share|improve this answer




























      0














      Here is the official response I received from help@mailgun.com:




      Your assumption is correct, the Opened and Clicked events do not
      contain the Subject line for the message that originated the tracking
      event.



      Currently, the Clicked and Open tracking links do not track the
      Subject line for the message it is tracking. The tracking links encode
      the Message-ID, Recipient, Domain, recipient variables, and other
      proprietary data that link the tracking address back to your account.
      Adding additional data to the tracking links would cause the link to
      increase the link's length and potentially label the link as
      suspicious or "spammy" by recipient spam filters.



      At this time, there are no plans to change the behavior of Clicked and
      Opened events, but we have a page set up to receive feedback/feature
      requests at http://mailgun.uservoice.com/. Feel free to submit this
      request. Other users can upvote the request, and our developers will
      review the requests and take them into consideration for future
      versions of our product.




      This excuse of theirs is frustrating because it's a lie: the length of the URL has nothing to do with whether or not they could report the subject (and any other attribute of the email) in the webhook.



      What Mailgun is expecting its users to do is exactly what Mailgun could do but chooses not to: store extra data alongside the message-id in a database and then use the message-id of the trackable link to fetch that extra data for webhook purposes.



      I will switch to a provider other than Mailgun, especially now that I also learned that Hotmail, MSN, and Live.com are all rejecting my Mailgun emails.






      share|improve this answer


























        0












        0








        0







        Here is the official response I received from help@mailgun.com:




        Your assumption is correct, the Opened and Clicked events do not
        contain the Subject line for the message that originated the tracking
        event.



        Currently, the Clicked and Open tracking links do not track the
        Subject line for the message it is tracking. The tracking links encode
        the Message-ID, Recipient, Domain, recipient variables, and other
        proprietary data that link the tracking address back to your account.
        Adding additional data to the tracking links would cause the link to
        increase the link's length and potentially label the link as
        suspicious or "spammy" by recipient spam filters.



        At this time, there are no plans to change the behavior of Clicked and
        Opened events, but we have a page set up to receive feedback/feature
        requests at http://mailgun.uservoice.com/. Feel free to submit this
        request. Other users can upvote the request, and our developers will
        review the requests and take them into consideration for future
        versions of our product.




        This excuse of theirs is frustrating because it's a lie: the length of the URL has nothing to do with whether or not they could report the subject (and any other attribute of the email) in the webhook.



        What Mailgun is expecting its users to do is exactly what Mailgun could do but chooses not to: store extra data alongside the message-id in a database and then use the message-id of the trackable link to fetch that extra data for webhook purposes.



        I will switch to a provider other than Mailgun, especially now that I also learned that Hotmail, MSN, and Live.com are all rejecting my Mailgun emails.






        share|improve this answer













        Here is the official response I received from help@mailgun.com:




        Your assumption is correct, the Opened and Clicked events do not
        contain the Subject line for the message that originated the tracking
        event.



        Currently, the Clicked and Open tracking links do not track the
        Subject line for the message it is tracking. The tracking links encode
        the Message-ID, Recipient, Domain, recipient variables, and other
        proprietary data that link the tracking address back to your account.
        Adding additional data to the tracking links would cause the link to
        increase the link's length and potentially label the link as
        suspicious or "spammy" by recipient spam filters.



        At this time, there are no plans to change the behavior of Clicked and
        Opened events, but we have a page set up to receive feedback/feature
        requests at http://mailgun.uservoice.com/. Feel free to submit this
        request. Other users can upvote the request, and our developers will
        review the requests and take them into consideration for future
        versions of our product.




        This excuse of theirs is frustrating because it's a lie: the length of the URL has nothing to do with whether or not they could report the subject (and any other attribute of the email) in the webhook.



        What Mailgun is expecting its users to do is exactly what Mailgun could do but chooses not to: store extra data alongside the message-id in a database and then use the message-id of the trackable link to fetch that extra data for webhook purposes.



        I will switch to a provider other than Mailgun, especially now that I also learned that Hotmail, MSN, and Live.com are all rejecting my Mailgun emails.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jan 1 at 15:46









        RyanRyan

        8,793866157




        8,793866157
































            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53993044%2fget-subject-of-opened-or-clicked-email-in-mailgun%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Iha2 glEpjuObzbLh,TMuW,aHIUh,aJffnsf7v0RDqGhtG
            U,sym,T7MNlqhCBdHCv3wOfcC7bSmF3,ZNTAgm LPyUHl7AHgCBirT8m KCWiuwhem,VA

            Popular posts from this blog

            Monofisismo

            Angular Downloading a file using contenturl with Basic Authentication

            Olmecas