Posted: September 25, 2016 at 6:37 am
|
Hi team, Recently I included your solution for sending the event data to Mailchimp (see this post). Would you be able to give some suggestions to get this done, mainly with respect to the EE-side function? Maybe there is a general way to pass shortcode content to merge vars? The purpose of this is to be able to include the ticket mail into the Mailchimp automation flow. This enables to maintain consequent styling through all messages. Cheers, |
Hi Luc, [TXN_TICKETS_URL] generates a link that shows ALL of the tickets assigned to a transaction regardless of weather or not that registration is Approved. Using the link you are requesting, are you looking to display all the tickets for a transaction or the single individual ticket for the registration the email is for? You can generate the same output as [TXN_TICKETS_URL] using the same method used in the ticketing add-on: \ee4-ticketing\EE_Ticketing.class.php around line 571 you’ll see how its done, you would use something like:
Then assign If you want the specific ticket for the registration you’ll need to do a little more work, here is an example that adds the ticket link to the ‘My Events’ section of the EE4 user add-on: https://gist.github.com/Pebblo/e56f98451d1aa0964717 Rather than assigning the ticket url to |
|
|
Dear Tony, Thanks for your swift and elaborate reply. I take it the call to Mailchimp is only made when a transaction is successfull and the registration is approved. In other words, the value of [TXN_TICKETS_URL], which is also used in the mail template, would only show valid tickets at the time the call to Mailchimp is made and the mergevar is somehow set up – right? I’m trying to find a similarity in the approach used to get the event date sent to Mailchimp. This is used for that:
So for the ticket url I would need something like:
Right? Cheers, |
|
There’s a
missing at the end. I’m aware of that. Sorry. I implemented and tested it, but there’s nothing passed to Mailchimp (the TICKETURL field remains empty). Did I make an (obvious) mistake? Best, |
That depends on your settings. Go to Event Espresso -> Mailchimp What is set for the ‘Submit to MailChimp when …’ option? If you only want that to happen when a registration has been fully approved you would set it to:
However a ticket is not ‘Valid’ unless it is Approved, so if you are checking the users in and scanning the tickets it make no difference if they have the tickets and have not paid… the ticket scan will show the ticket is not valid. Your code should work, however you have this:
Which basically says, if $approved_only is true, set that value to ‘ee-txn-tickets-approved-url’ otherwise set it to ‘ee-txn-tickets-url’… but you have no $approved_only var. It depends on how you want to handle the values but I would use:
|
|
|
Dear Tony, I included the change you proposed, but unfortunately still nothing is passed to Mailchimp. The setting of the Mailchimp segment is indeed “registration is completed with an approved status.”
But they don’t get the tickets until paid, right? Assuming the only payment options offered are the on-line payment options, i.e. you can’t do a bank transfer or get an invoice. Best,
|
That’s correct, they should not receive the tickets until they have paid (or the registration is Approved).
Looks like MailChimp doesn’t like the full URLs being passed as merge vars, I get the same problem when testing the above on a test site. Another option is to just pass over the reg_url_link and build out the ticket URL in mailchimp yourself, for example:
You can add that to the same function that adds the event date rather than 2 separate functions. Just make sure its before:
Then you have a TICKETPARAM merge var in your list, so within your campaign your should be able to do something like:
And that will generate the ticket url for that user on the fly, see: Note the above is not fully tested or supported, if you need further help with this you may need to contact a developer to pull the details over for you.
|
|
|
Dear Tony,
I named it TICKETURL because I already had that merge var set up. Both TICKETURL and EVENTDATE are set up identically (but for the field type of course, website vs. date field). Is there a clear way to check whether the variable is actually assigned a value and send to Mailchimp, just to evaluate whether the problem is at Mailchimp’s side or at the website level? |
Change the field type of your TICKETURL merge var to Text, its not a URL any more. You may need to remove and recreate it to do so, or to test just create another and set that value above, for example TICKETURL2 as a text field, then send the value to both fields and see if it passes over.
Not easily. You would need to output the merge vars and capture the value within the ajax request. |
|
|
Thank you Tony, we’re getting somewhere! |
Apologies, the forum messed with my link formatting in the example above (fixed now). That link should be: http://www.panoramarail.nl/?ee=ee-txn-tickets-url&token=1-c44ebada63f3e4c7a05d4b3b898e28cd Note the link now includes |
|
|
Cool, works like a charm. Is there also a similar variable which holds the URL for the change attendee information option as displayed upon completion of the registration? Since, in my case, only the primary registrant has to enter information (attendee details), there’s always just one linked shown at the end. |
EE includes all of this information within the standard messages so it is available, but you will need to find how the link is created and pass over the needed information to mailchimp. Take a look within the Receipt message for an example of the There is also the See how those shortcodes output the link and re-build that within MailChimp. Note they both use the reg_url_link() value you passed over for the ticket, just in a different link. You may want to change the merge var to a different name as it can be used for multiple different functions. |
|
|
Thanks for your great support! 🙂 |
You’re most welcome 🙂 |
|
The support post ‘Ticket url to Mailchimp’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.