The Community forums are being phased out in favor of a new Slack group.
Add your email address below to get an invitation to join the community slack group

Slack Signup
Newsletter Optin
Help Desk

Email Notification - [if # equals=“”] pulling in additional field data outside of command

Labels

This Discussion is public

Notifications

I have If statements that pull in payment information based on selection on the pull down field of "Payment Method". This is in an Email Notification. All of the CC information is working correctly, but [if 121 equals="Purchase Order - Terms Net 30 Upon Pre-Approval"] is not only pulling in the correct data but also pulling in the CC data even though this isn't between the [if # equals=""] [/if #] tags.  Can someone look at the code and tell me what I am missing?  I'm crosseyed at this point!

<b>Payment Information:</b>
[if 121 equals=“Visa”]
<table style="font-family: times;" "font-size: 22 px" border="1" width="800">
<tbody>
<tr>
<td width="50%">Payment Method: [121]</td>
<td width="50%">CC #: [159]</td>
</tr>
<tr>
<td>Sec Code: [123]</td>
<td>Exp Date: [166]</td>
</tr>
<tr>
<td>Name on Card: [127]</td>
<td>P.O. Ref No: [199]</td>
</tr>
<tr>
<td>CC Statement Street #: [197]</td>
<td>Zip Code:  [198]</td>
</tr>
<tr>
<td>Additional Email For Receipt: [200]</td>
<td></td>
</tr>
</tbody>
</table>[/if 121]

[if 121 equals=“MasterCard”]
<table style="font-family: times;" "font-size: 22 px" border="1" width="800">
<tbody>
<tr>
<td width="50%">Payment Method: [121]</td>
<td width="50%">CC #: [159]</td>
</tr>
<tr>
<td>Sec Code: [123]</td>
<td>Exp Date: [166]</td>
</tr>
<tr>
<td>Name on Card: [127]</td>
<td>P.O. Ref No: [199]</td>
</tr>
<tr>
<td>CC Statement Street #: [197]</td>
<td>Zip Code:  [198]</td>
</tr>
<tr>
<td>Additional Email For Receipt: [200]</td>
<td></td>
</tr>
</tbody>
</table>[/if 121]

[if 121 equals=“Discover"]
<table style="font-family: times;" "font-size: 22 px" border="1" width="800">
<tbody>
<tr>
<td width="50%">Payment Method: [121]</td>
<td width="50%">CC #: [159]</td>
</tr>
<tr>
<td>Sec Code: [123]</td>
<td>Exp Date: [166]</td>
</tr>
<tr>
<td>Name on Card: [127]</td>
<td>P.O. Ref No: [199]</td>
</tr>
<tr>
<td>CC Statement Street #: [197]</td>
<td>Zip Code:  [198]</td>
</tr>
<tr>
<td>Additional Email For Receipt: [200]</td>
<td></td>
</tr>
</tbody>
</table>[/if 121]

[if 121 equals=“American Express"]
<table style="font-family: times;" "font-size: 22 px" border="1" width="800">
<tbody>
<tr>
<td>Payment Method: [121]</td>
<td>CC #: [159]</td>
</tr>
<tr>
<td>Sec Code: [123]</td>
<td>Exp Date: [166]</td>
</tr>
<tr>
<td>Name on Card: [127]</td>
<td>P.O. Ref No: [199]</td>
</tr>
<tr>
<td>CC Statement Street #: [197]</td>
<td>Zip Code:  [198]</td>
</tr>
<tr>
<td>Additional Email For Receipt: [200]</td>
<td></td>
</tr>
</tbody>
</table>[/if 121]

[if 121 equals="Purchase Order - Terms Net 30 Upon Pre-Approval"]
<table style="font-family: times;" "font-size: 22 px" border="1" width="800">
<tbody>
<tr>
<td width="50%">A/P Email: [161]</td>
<td width="50%">A/P Phone: [162] Ext: [188]</td>
</tr>
<tr>
<td>A/P Contact: [160]</td>
<td>Additional Email for Receipt: [200]</td>
</tr>
<tr>
<td>Payment Method: [121]</td>
<td>P.O. Ref No: [122]</td>
</tr>
</tbody>
</table>[/if 121]

Thank you for any help you can give!

Christy

It's difficult to say what's happening based on the code you've shared. There is nothing obvious wrong with it. It is a lot of code though that can be condensed into two if statements. I would use "if 121 equals="Purchase Order..." for the Purchase order display, and "if 121 not_equal="Purchase Order..." for the credit cards since you're using the same fields for all four.

I would also use the Kint PHP debugger so you can see the actual values being pulled from Formidable. https://wordpress.org/plugins/kint-php-debugger/

Other than this, there isn't anything else I can offer without access to admin.

I agree with Victor, this could be simplified with only 2 conditional statements. Also, I tend to use this instead:

 
[if 121 like="Purchase Order"]
That way, if I change the text in the label of the field from "Purchase Order - Terms Net 30 Upon Pre-Approval" to something like "Purchase Order - Terms Net 30 (requires preapproval)" when I'm fiddling with the form design (which I do a lot!), it's less likely to break my conditionals.

On the actual errors that you're seeing, maybe it's due to some problems with the table tags? I'm not certain this is it, but the way the style is written in each of them looks funky to me:
<table style="font-family: times;" "font-size: 22 px" border="1" width="800">

I think it should be
<table style="font-family: times;font-size: 22px;" border="1" width="800">

Discussion closed.