Discussions

 View Only
  • 1.  Free script to send record values to mandrill email templates.

    Posted 11-20-2017 14:34
    A scalable script to send values from a record to a mandrill(mailchimp) email template.
    https://gist.github.com/chucksupport/56733f7671bcec0429d11e50061fc0ec#file-qbtomandrill


    Instructions:
    Requirement: IOL technique.
    Requirement: Mandrill API key and QB apptoken

    Configuration:
    In the script you'll see an object like this. copy the object jobSheet or bookingTicket or rename them. For the fields you enter the exact name (no spaces) of your merge tag *|MERGE_TAG|* and the quickbase field ID of the field you want pushed to that tag in your email. More comments in the code below and in the script. If you need any help you can reach out directly
    earn.com/chuck

    fields:{MERGE_TAG:"123"}

    var template = {


        jobSheet: {
            timestampField:"_fid_342", //the field on the form you want to timestamp when the email was sent.
            fields: {
                enterMailchimpMergeTagName: "123" //the id of the quickbase field
            },
            msgObj: {
                "template_name": "templateName" // the slug of the mailchimp template
                "template_content": [{
                    "name": "Job Sheet",
                    "content": "Job Sheet Information"
                }],
                "message": {
                    "from_email": "FROM EMAIL",
                    "to": "",
                    "subject": "job sheet for ",
                    "text": "Find your job sheet information below.",
                    "merge": true,
                    "global_merge_vars": [],
                    "merge_vars": ""
                }
            }
        },

        bookingTicket: {
            timestampField:"_fid_341",
            fields: {
               

            },
            msgObj: {
                "template_name": "bookingticket",
                "template_content": [{
                    "name": "Booking Ticket",
                    "content": "Booking Ticket Information"
                }],
                "message": {
                    "from_email": "FROM EMAIL",
                    "to": "",
                    "subject": "booking ticket for ",
                    "text": "Find your booking ticket information below.",
                    "merge": true,
                    "global_merge_vars": [],
                    "merge_vars": ""
                }
            }
        }
    }



    After its all setup then you would add a couple buttons on your form that trigger the mail().

    in this example i want to send jobsheet so the button would have javascript:mail(template.jobSheet); return false;

    again happy to answer any questions or if ya need assistance implementing it. Earn.com/chuck


  • 2.  RE: Free script to send record values to mandrill email templates.

    Posted 12-12-2017 07:17
    Thanks for sharing this with the community. :)

    Cheers,

    Gaurav


  • 3.  RE: Free script to send record values to mandrill email templates.

    Posted 12-29-2017 13:33
    Can this be done through webhooks?


  • 4.  RE: Free script to send record values to mandrill email templates.

    Posted 12-29-2017 18:25
    I'm just using APIs for mandrill and QB. I'm sure it's possible but may be easier to just use this. Welcome to contact me if ya have questions. Earn.com/chuck


  • 5.  RE: Free script to send record values to mandrill email templates.

    Posted 11-29-2018 13:55
    Do you have to create buttons, or can this be triggered with notifications?



  • 6.  RE: Free script to send record values to mandrill email templates.

    Posted 02-12-2019 19:30
    The way it's set up you have to use buttons. Let me know if you would like any help. Chuck.Support