We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 14162
    • 67 Posts
    Quote from: BobRay at Apr 09, 2015, 10:02 PM
    FYI, there is also the MandrillX class, though you'd still need a custom FormIt postHook to run it. Notify has been using it for some time and it's very reliable. http://modx.com/extras/package/mandrillx

    The MandrillX Class works really well and I'm sending emails via the API with no problems - however, I can't seem to send emails using a predesigned Mandrill template. Instead I generate the email content in Modx and send this via the API. I'd rather use the template on Mandrill and simply send the variables (e.g. name, email, links etc.). Is there a way to reference the template in the snippet? The Mandrill API docs suggest that a template_name can be included in the parameters, but I don't think the MandrillX class has this included (yet).

    Thanks

      • 3749
      • 24,544 Posts
      You might look at the code of Notify. I'm pretty sure it uses a Mandrill template.
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 14162
        • 67 Posts
        Quote from: BobRay at Oct 23, 2015, 09:13 PM
        You might look at the code of Notify. I'm pretty sure it uses a Mandrill template.

        As far as I can tell it uses the same approach as MandrillX - namely either HTML or text is generated in Modx and sent to the Mandrill API. I need to be able to use a Mandrill template itself.
          • 3749
          • 24,544 Posts
          Sorry, I was reading that as using a MODX template to send through Mandrill.

          IIRC, Notify sends the template once to Mandrill, then sends the data to use with it. I like doing it that way because I don't have to log in to Mandrill to alter the template and it still avoids sending the whole text for each outgoing message.
            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting
            • 14162
            • 67 Posts
            Quote from: BobRay at Oct 27, 2015, 03:12 PM
            Sorry, I was reading that as using a MODX template to send through Mandrill.

            IIRC, Notify sends the template once to Mandrill, then sends the data to use with it. I like doing it that way because I don't have to log in to Mandrill to alter the template and it still avoids sending the whole text for each outgoing message.

            It works fine that way - BUT, Mandrill provides better tools for creating and managing email templates than Modx (for obvious reasons). If I get time I might take a look at adapting your MandrillX class.