Sending email after updating a record.. Coldfusion

Any tips and tricks that has to with the ADDT that doesn't fit into one of the other categories
jlig
Posts: 35
Joined: 2010-07-09 16:17

Sending email after updating a record.. Coldfusion

Post by jlig » 2012-02-22 23:49

I'm trying to take your idea about sending email after updating a record, but it is not working? (your code is below)

- When I apply it to my page and add the Check Box, it will not work..
- In the past, using ColdFusion, I have used Send Email via ADDT .. but not with a Check Box

When the email goes out,
- All of my Email variables such as {rsLocatesDetail.ticket} are not populating with dynamic data?

Lastly, what would the check box "condition" be if using ColdFusion (the PHP condition is {POST.mail} == "1")

Thanks,
jlig



---------------------------------------------------------------------
Sometimes you want to send an email only under certain circumstances after updating a record.

To do that follow the following procedure.

Create your Custom Form or NeXTensio form as usual.
Add a "Checkbox" next to the buttons at the bottom of the page using the following values:
<input name="mail" type="checkbox" id="mail" value="1">
Add your "Send Mail" behaviour
Under the "Advanced Tab" select the transactions you want this email to be sent;
Insert, Update or delete, Give it a high priority and of type "AFTER"
Click each transaction in turn In the condition field and enter the following for every transaction type:
{POST.mail} == "1"
Click OK
When the user wants to send an email he / she then needs to tick the checkbox.
The script check if the value of the checkbox called "mail" is set to "1"

If it is set, the send mail SB will execute and the email will be sent.

If the value is not set, the email will not be sent.

User avatar
Fred
Site Admin
Posts: 491
Joined: 2010-02-15 12:10
Location: Armagh, Northern Ireland
Contact:

Re: Sending email after updating a record.. Coldfusion

Post by Fred » 2012-02-26 10:34

Never used Coldfusion but a quick google gave me this with regards to "normal" checkbox validation
<cfif Form.mail EQ "1">
so could you be looking at {Form.mail EQ "1"}

jlig
Posts: 35
Joined: 2010-07-09 16:17

Re: Sending email after updating a record.. Coldfusion

Post by jlig » 2012-02-29 23:24

Fred, Thanks for that suggestion.. If the box is checked and Update button is clicked the email goes out.. good!
But if the box is Not checked and the Update button is clicked the email does not go out.. and a blank page displays that says "undefined" ?

Here is what the code looks like in the page:
// Register triggers
upd_tickets.registerTrigger("STARTER", "Trigger_Default_Starter", 1, "POST", "KT_Update1");
upd_tickets.registerTrigger("BEFORE", "Trigger_Default_FormValidation", 10, formValidation);
upd_tickets.registerTrigger("END", "Trigger_Default_Redirect", 99, "../includes/nxt/back.cfm");
upd_tickets.registerConditionalTrigger("Form.mail EQ ""1""", "AFTER", "Trigger_SendEmail", 40);

User avatar
Fred
Site Admin
Posts: 491
Joined: 2010-02-15 12:10
Location: Armagh, Northern Ireland
Contact:

Re: Sending email after updating a record.. Coldfusion

Post by Fred » 2012-03-01 09:11

Check in the folder where the script is running, there should be an error.log file telling you what is the error.

jlig
Posts: 35
Joined: 2010-07-09 16:17

Re: Sending email after updating a record.. Coldfusion

Post by jlig » 2017-01-10 16:51

Fixed this. The issue was on the "email template page".

- I use the "MX Send Email" but choose my own html template for the email body
- The "blank white screen" was caused by a missing field on the form page.
- I added that field as a hidden field.
Now that missing field is passed to the email template and the "blank" screen is gone.

Post Reply