Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Including entry fields in email notification #18

Closed
tidy opened this issue Jan 30, 2019 · 2 comments
Closed

Including entry fields in email notification #18

tidy opened this issue Jan 30, 2019 · 2 comments

Comments

@tidy
Copy link

tidy commented Jan 30, 2019

Thanks for this great plugin. I am using it to send an email notification when a new entry is added.

One thing I am stuck on is how to include fields from the new entry (other than the title) in the email.

I tried looking at the $this->event object and saw a customFields array within in with the various values, but I couldn't seem to find the code that would work here. If this is possible, could you tell me the syntax to use to output a field value in the email? Many thanks.

@riasvdv
Copy link

riasvdv commented Feb 1, 2019

Hi, in the event you should just be able to assign the event sender to an entry variable:

$entry = $this->event->sender;

You can access every custom field from the entry: $entry->my_field_handle

@tidy
Copy link
Author

tidy commented Feb 1, 2019

Brilliant - many thanks for explaining this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants