Hi, this is my form below >>
You will see a box on the right, this is a foreach echo of my email templates, what I want to do is when someone clicks on one of those templates the form info is taken along with the selected template and the form fields are inserted into the template and emailed, but im not sure if to do this in another form, or if it can be done in the same form as all the details are on that page anyway as the templates are echo'd in the foreach code.
You will see a box on the right, this is a foreach echo of my email templates, what I want to do is when someone clicks on one of those templates the form info is taken along with the selected template and the form fields are inserted into the template and emailed, but im not sure if to do this in another form, or if it can be done in the same form as all the details are on that page anyway as the templates are echo'd in the foreach code.

Hi crea2k,
I think you can do this with a switch statement in the email body:
Bob
I think you can do this with a switch statement in the email body:
<?php
switch ( $form->data['template'] ) {
case 'hello':
echo "message contents . . .";
break;
case 'sorry':
echo "Sorry I missed . . .";
break;
. . . // and so on
}
?>
Bob
Thanks Bob, im not too sure what that is, as my php is a bit basic but learning fast so will read up on it and have a play to see if I can get it working, I was thinking of putting it into a session but wasnt sure how to clear the session once it had been created as I didnt want the user data getting mixed up.
Hi crea2k ,
Usually you don't need to use sessions unless you are using more than one form.
Bob
Usually you don't need to use sessions unless you are using more than one form.
Bob
Hi Bob, I am using another form which takes all the info from the previous form (name, email, template name selected, template message associated with that template) and emails the person, I have manage to get it working, I wrapped each template in the list in an <a> tag with the token being referenced at the end. I then created an email form that looked for that token and loaded the template into the form. I then used the data to session to put the contact details into the session, then on the email form used the session to data to import the contact details, so I now have a form with :
[template name]
[template message]
[leadname]
[email]
....so far so good, I just have to add the email part now...fingers crossed🙂.
[template name]
[template message]
[leadname]
[email]
....so far so good, I just have to add the email part now...fingers crossed🙂.
This topic is locked and no more replies can be posted.