Support

Home Forums Event Espresso Premium Can I have ACF content added to any of the Messages (Batch or Automated)?

Can I have ACF content added to any of the Messages (Batch or Automated)?

Posted: January 9, 2025 at 11:17 am

Viewing 31 reply threads


Portland Fashion Institute

January 9, 2025 at 11:17 am

I’ve search the forum and see that a couple people have asked similar questions in years past and the answer was no, but then I found this post and now I’m not sure:

https://eventespresso.com/topic/acf-field-on-automated-emails/

Can I have ACF Data spit out into the Message templates?
Thanks guys,
S


Portland Fashion Institute

January 14, 2025 at 9:42 am

Hello Fella’s – Any news for me on this question?
Thank you!
S


Tony

  • Support Staff

January 14, 2025 at 10:26 am

Hi,

Apologies! I thought I’d replied to this!

The answer is yes and no (That’s a great answer that, Tony! πŸ™‚ ).

ACF is ‘just’ storing custom fields with a post type, so technically EE can already pull in those values using the [EVENT_META_*{meta_key}] shortcode where you pass the key of the custom field to that shortcode in place of {meta_key}. With a ‘standard’ custom field that’s relatively simple, like this:

https://monosnap.com/file/Fujbw8EHs8YhqcxdlQqCodUgBBxhRG

And the shortcode would just be:

[EVENT_META_*default_source]

The output in that specific case would be ‘Testing’.

The ‘problem’ is that ACF also does a bunch of other processing and allows for wayyyyy more custom field types than WordPress does and that’s where you’ll run into problems becuase EE doesn’t know anything about ACF i itself, so the value you get back from ACF may not be the value you expect (it may store the ID of some value from a custom table within the custom field and then have say a Date stored with that ID) ACF knows how to pull the correct data, EE will not.

So yes, as it stands EE will indeed pull ‘a’ value for an ACF field is you pass it the correct custom field meta_key for it… but if that’ll be the correct field is another story.

To pull the correct field another shortcode needs to be created that will pull in the value in the way that ACF wants it to be done, if that’s a hard requirement for you its something we may be able to do with 1/2 support tokens (will need to asses how long it will take before moving forward).


Portland Fashion Institute

January 14, 2025 at 11:16 am

I would love to get an estimate. I’m getting some clarifications from PFI on what that data looks like. I know it will be text and html links to some files. It could all get dumped into a text-area ACF element I believe. What I don’t know is if that data would then get sent attached to the Registration Approval message or the (as yet to be setup) Reminder email that gets sent out. Not sure if that makes any difference.

Thanks for looking into costs Tony!
Shelly


Portland Fashion Institute

January 21, 2025 at 10:48 am

Hey Tony – do you have any information for me on this – PFI would love to have this functionality testing by next week if possible. Please let me know. In the meantime, I’m going to create the ACFs where we will store data – and I can provide you access to our Staging environment (let me know how to do that privately).


Tony

  • Support Staff

January 22, 2025 at 6:54 am

Hi Shelly,

My apologies, I think I misunderstood your previous reply here. I was waiting on more details based on this:

I’m getting some clarifications from PFI on what that data looks like. I know it will be text and html links to some files. It could all get dumped into a text-area ACF element I believe.

I need to know which data types we are working with to be able to answer this.

If you have the ACF fields set up I’ll take a quick look and let you know.

Just send temp login details over using this form:

https://eventespresso.com/send-login-details/


Portland Fashion Institute

January 22, 2025 at 11:39 am

Oh! Brilliant. Sorry about that – okay. So I just sent it over…

The email we’d ideally like this info to go into is the Primary Registrant Registration Approved email… I think… I should say that I’m not 100% sure the difference between the Primary Registrant and just Registrant emails – so if its easier to go into one or the other, I guess I need to better undstand that. I “THINK” we just use the Primary Registrant email message.


Tony

  • Support Staff

January 22, 2025 at 2:02 pm

Oh! Brilliant. Sorry about that – okay. So I just sent it over…

Ok, thank you, I can see it.

You’re looking at roughly an hour to code and test his so it would be 2 Support Tokens and I should be able to get that done today/tomorrow depending on when/if you give the thumbs up.

The shortcode should allow you to pull most ACF fields into the email content, spring an edge cases, but text fields your using now would be fine.


Portland Fashion Institute

January 23, 2025 at 10:26 am

Ok – I’m going to go ahead and pay for this, but I just need to reiterate that we have both text and links (so that’s why I chose the WYSIWYG ACF element intstead of just the text one). The information we’re including in the Registrant Email is both text and links. Thank you!!


Tony

  • Support Staff

January 23, 2025 at 2:30 pm

Huh? Sorry, I don’t follow.

What is the difference between text and links here?

Links are basically just text in a specific format that your browser can understand.

So:

This is some text

and….

<a hre="https://www.google.com">THIS</a> is also just some text but formatted with a link within it

Both should output fine within the message template from a WYSIWYG ACF element.


Portland Fashion Institute

January 23, 2025 at 5:16 pm

Sorry to make it complicated. I’m working with people who don’t know how to add the html for a text link but can link something in word and then cut and paste it into the field… so a basic text only element for ACF would lose the link portion and just show the text when cutting and pasting from word. But if the element is a WYSIWYG one, then that href will reamin attached and functioning.


Tony

  • Support Staff

January 24, 2025 at 10:58 am

Ohh, sorry now I follow.

Ok so I have this ready to go; where would you like for me to add it?

I can package it up as a separate plugin or would you like it somewhere specific?


Portland Fashion Institute

January 27, 2025 at 10:31 am

Ooooo good question. A separate plugin sounds smart. If that’s not too much work Tony? THANK YOU!!!


Tony

  • Support Staff

January 29, 2025 at 6:34 am

Hi Shelly,

Apologies for the delay, I asked one of our developers to review before adding to the site just to be sure (all good).

I’ve add the function to a custom functions plugin on the site and it now adds a [ACF_FIELD_*] shortcode within the message system, right now it loads on the EVENT_LIST section of the messages.

You just pass the field name to the shortcode after the *, so for example you have an ACF field for ‘Class Must Knows’ wand the field name for that in ACF is
what_you_need_to_know, so the shortcode for that field is:

[ACF_FIELD_*what_you_need_to_know]

That will pull the details from that field into the message for you.

Please do let me know if you run into any issues.


Portland Fashion Institute

January 29, 2025 at 11:29 am

FANTASTIC!!! Thanks for being thourough and careful. I appreciate you!
Very excited… will begin using very soon. THanks so much Tony!


Tony

  • Support Staff

January 29, 2025 at 2:49 pm

You’re most welcome πŸ™‚

Please do let me know if you run into any issues.


Portland Fashion Institute

February 4, 2025 at 1:48 pm

Hey Tony – can I nest ACF shortcodes into this new ACF field you helped connect up to our Email Messages?

So for example, I created a “Supply List” link in ACF and attached it to each class, but students can only get to this when the class is still up and accepting reservations – once the class has started, there is no way for them to get to the supply list – HOWEVER… I could maybe stick it in this new “What_you_need_to_know” ACF field you helped me with.

There are a few custom fields I’d love to buy default include.

Thank you!
Shelly


Tony

  • Support Staff

February 4, 2025 at 3:58 pm

Hi Shelly,

Hmmm, I don’t think you can no (that’s an ACF feature question rather than this snippet as your trying to nest ACF fields within ACF fields and the snippet just uses get_field to pull in the value).

But.,.. unless I’m misunderstand, wouldn’t you just include another shortcode to pull in that acf field?

[ACF_FIELD_*what_you_need_to_know]
[ACF_FIELD_*supply_list]

Would that not work?


Portland Fashion Institute

February 4, 2025 at 4:16 pm

Ohhhhh so you mean that you provided the ability for me to pull ACF stuff into the email – Then YES!!!! Oh Holy cow, I’m a dork.

Thanks much Tony!!!


Portland Fashion Institute

February 5, 2025 at 10:38 am

TOny – I tried to do that – it did not work. I added this:

  • <span style=”color: #e3200e”>SUPPLY LIST:</span><br /> [ACF_FIELD_*class_supply_list]
  • <span style=”color: #e3200e”>INSTRUCTOR:</span><br /> [ACF_FIELD_*instructor]
  • To the Event List section of the message. The oringinal one you worked with still worked but these two new ones did not.

    These 2 ACF fields are part of a different Field Group, which has multiple separate fields – whereas the one you helped me set up (what you need to know) is the only field in that particular field group. Could that be the issue? Just spit balling.

    Thanks – sorry to be such a royal pain in the ass.


    Portland Fashion Institute

    February 5, 2025 at 10:38 am

    TOny – I tried to do that – it did not work. I added this:

  • <span style=”color: #e3200e”>SUPPLY LIST:</span><br /> [ACF_FIELD_*class_supply_list]
  • <span style=”color: #e3200e”>INSTRUCTOR:</span><br /> [ACF_FIELD_*instructor]
  • To the Event List section of the message. The oringinal one you worked with still worked but these two new ones did not.

    These 2 ACF fields are part of a different Field Group, which has multiple separate fields – whereas the one you helped me set up (what you need to know) is the only field in that particular field group. Could that be the issue? Just spit balling.

    Thanks – sorry to be such a royal pain in the ass.


    Tony

    • Support Staff

    February 5, 2025 at 10:54 am

    Hmmm, which event and which message template are you editing?

    I’ll take a look on the site.

    These 2 ACF fields are part of a different Field Group, which has multiple separate fields – whereas the one you helped me set up (what you need to know) is the only field in that particular field group. Could that be the issue? Just spit balling.

    That shouldn’t matter, each individual field is still just a field. The groups allow you to organize them better.


    Portland Fashion Institute

    February 5, 2025 at 11:03 am

    It’s the same, [EVENT_LIST]


    Tony

    • Support Staff

    February 5, 2025 at 11:04 am

    Which template are you editing though?

    I can’t see your shortcodes it in the default templates, so I’m assuming your using a custom template? For which event?

    I currently don’t know where to look to see what changes you are making.


    Portland Fashion Institute

    February 5, 2025 at 11:08 am

    Oh I’m a dork. Sorry
    https://portlandfashioninstitute.com/events/beginning-sewing-level-ii/

    Let me test registering again tho… just in case it was a cache issue…


    Portland Fashion Institute

    February 5, 2025 at 11:11 am

    Yeah there is something weird going on… a lot of my updates are not show. Hold off doing anytyhing for now – maybe I’m getting Primary Registrant and Registrant templates confused. Let me duplicate my changes to both and dump server cache and retry… sorry Tony!


    Portland Fashion Institute

    February 5, 2025 at 11:30 am

    I am such a dork. I was testing the wrong email. THANK YOU – all working. Pleae ignore me…


    Tony

    • Support Staff

    February 5, 2025 at 1:28 pm

    This reply has been marked as private.


    Portland Fashion Institute

    February 5, 2025 at 2:02 pm

    Well, I’m not 100% sure I understand however, I can say that the only “Unique” parts of what is now our default Approved Registration Message Templae, are only those things being caught by the ACF fields. All that other stuff is meant to get sent to all students who register for any old class. So the only Unique info will be the ACF fields (which are edited at the Event Level).

    If we have to create unique Messages for each class, then it defeats the purpose of creating those ACF fields in the first place -I’d just add that stuff to the template instead.

    Am I wrong? Do I need to revert?

    -S


    Tony

    • Support Staff

    February 5, 2025 at 2:22 pm

    Oh, so all of your events use those ACF fields and will have their own values for those?

    I’m not saying don’t use the ACF shortcodes, I assume only some of your events pulled values for those, but if they are used on all, then you can ignore me as yes, that’s what they are for πŸ™‚


    Portland Fashion Institute

    February 5, 2025 at 2:41 pm

    Yes! Whew! That was a close one! πŸ™‚ Thank so much Tony!!!! I think we got it working!


    Tony

    • Support Staff

    February 5, 2025 at 2:48 pm

    Awesome, I’m glad its working and you’re most welcome πŸ™‚

    Viewing 31 reply threads

    You must be logged in to reply to this support post. Sign In or Register for an Account

    Event Espresso