Posted: March 25, 2020 at 6:22 pm
|
I saw this code you can send the ticket date to Mailchimp: https://github.com/eventespresso/ee-code-snippet-library/blob/master/addons/eea-mailchimp/tw_eea_mailchimp_start_date.php Is there a way I can send what ticket type they selected to Mailchimp? Or if it’s easier, the amount of the ticket? I’m on Event Espresso 4.10.2.p |
Hi John,
Yes, the filter allows you to add pretty much any details you want to it but we don’t have a snippet that does this already. May I ask what you mean by ticket type? I’m assuming the ticket name?
You can add both if needed. Are you comfortable with PHP? |
|
|
Hi Tony, I’m pretty good with PHP. Happy to add a snippet if you can help out with it. |
The snippet would be very similar to the one you’ve linked to, only you’d use the Create your mergee var on MialChimp, then these lines would be something like:
https://github.com/eventespresso/event-espresso-core/tree/master/docs/G–Model-System |
|
|
Worked like a charm. I created the “TICKETNAME” merge field in Mailchimp. Then I added this code to my functions.php and it passed the ticket name just right.
In case I want to do price later, can you let me know what the code would be for it? I just need this piece: $merge_vars[‘TICKETPRICE’] = $ticket->price(); Is that right? |
Correct. If you use something like kint debugger and wrap the object in |
|
|
Thanks. I’ll have my development team dive into it once we turn the Mailchimp email into a full receipt. I appreciate you helping me with the immediate need though. I love that I could guess it though 🙂 |
|
And just for good measure. Here’s the final code I used to push the ticket name and price to Mailchimp:
This requires MERGE tags to be created for your list in Mailchimp as follows: TICKETNAME and TICKETPRIC Note: I had to to TICKETPRIC since there’s a limit on length of a MERGE Tag in Mailchimp. Works like a charm. Thanks! |
Great, I’m glad you have a working snippet. Just a side note, we use TKT as shorthand for ticket, so you could use TKTNAME and TKTPRICE to have consistent naming if preferred. |
|
The support post ‘Send Ticket Selection 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.