I have Uniform up and running, but want to use a snippet. I have read this, but still don’t understand what I need to change, exactly, in my actions/email.php file to point to my snippet rather than use the default. Obviously, I’m new at this.
Sorry - wasn’t clear. I want to use a snippet for my email template. (I already have the form itself in a snippet.) I have created an email template snippet, but I do not know what to change in the email action to point to that snippet instead of using the default email template.
The thread I linked to discusses including the value from “_from” field in the email that is sent after the form is submitted. To do this, you need to first create an email template snippet and, next, modify the actions/email.php
My problem is I do not know what to change in actions/email.php to tell Uniform to use the new custom email snippet for its template rather than the default template.
This link explains what should happen, but I am afraid I do not know what code to change to make it work.
I don’t have any code to post because my issues is I do not know what code to change.
Just had a simple error in the way I was calling the snippet. It’s properly referenced now. But I’m getting another error. I’m using a snippet from the repo: email-table.php
I’m getting an undefined error on the $data variable:
foreach ($data as $field => $value):
Whoops \ Exception \ ErrorException (E_NOTICE)
Undefined variable: data
Update:
So it turns out that line should be:
foreach ($form as $field => $value):
This seemed like a logical fix, because in uniform/actions/email we’re using:
Just as a side note: Please note that the syntax above refers to the old Uniform plugin. In the new version, the options are still the same including the way to reference a snippet, though. See the documentation.