92 Posts
Seb
10 years ago
6
Topic
Hello
I have 2 problems with the email field.
1 / conditions does not support this field, for example:
"disabled" when "field name = 1"
The field is enabled and the email is sent

2 / The value "0" is not included in the message, for example:
My message indicates a price in euros: "Total: 36 euros," when the price is equal to 0 euros, the number 0 is not displayed and I get "Total: EUR" instead of "Total: 0 EUR" the number 0 is nonetheless recorded in the database.

Thank you in advance for your help.
Seb
Get a Book for SEBLOD
10 years ago
5
Level 1
Hi Seb,

Can you share with us the configuration of your email field.

Regards,
Mehdi.
92 Posts
Seb
10 years ago
4
Level 2
Hello Mehdi,
The email is sent to the form submission directly. I wanted to have two different email when submitting the form.
If the condition "A" is respected, the email field is set, then email "1" is sent.
If the condition "B" is respecting the email field is set, then email "2" is sent
Maybe I should use another field, with condition, that sends the value "submission"?
Thank you for your help
Seb
10 years ago
3
Level 3
Seb,

What is the difference between "email1" and "email2" ? This difference is in the message ?

Regards,
Mehdi.
92 Posts
Seb
10 years ago
2
Level 4
Mehdi thank you for your reply,
Yes the difference is in the message.
Depending on the options chosen in the form I want to send a different e-mail.
Seb
10 years ago
1
Level 5
Hello Seb,
a way to do that is to use the plugin Field Code "Afterstore".

In your form, in the hidden position, you put 3 fields (keep the order below):
  • Plugin Field AfterStore
  • Plugin Field Email 1
  • Plugin Field Email 2

in the Plugin Field Afterstore you just have to put your two conditions:
If ( !$fields['condition1']->value ){
unset( $fields['email1'] );
}
If ( !$fields['condition1']->value ){
unset( $fields['email2'] );
}
$fields is the table with all fields of your form.
In the Plugin Field Email, all emails are send in the event "AfterStore", so if you unset undesirable fields before this event, they won't be executed.

Best regards.
Lionel
92 Posts
Seb
10 years ago
0
Level 6
Thank you for your reply.
Finally I used a single e-mail, but your solution may be useful for another form.

Thank you,
Seb

Get a Book for SEBLOD