Have an idea?

Visit Sawtooth Software Feedback to share your ideas on how we can improve our products.

Red flags using Sawtooth Software

I have a client who is very interested in implementing a "red flag" within their survey.

We have a question: "Q20. Would you like your regional manager to contact you about this urgent matter?" (Yes / No)

If Q20=Yes, we would like to send an email within the Sawtooth Software survey.

We need to cater for the following ...

*"From email address" would be a constant.
*"To email address" would come from within the survey (either a merged sample field or a survey question and we may have multiple email addresses to send to).
*"Subject heading" which may require piping of variables / questions.
*HTML script in the "email body" which may require piping of variables / questions.

Looking forward to a nifty solution. Regards Paul.
asked Aug 19, 2016 by Paul Moon Platinum (98,670 points)
Hi Paul,

I have to implement the process pretty much exactly as you have specified here.
Did you come up with a solution?
cheers,
Paul
Hi Paul. We didn't come up with an ideal solution at the time.

We got around it with a partly automatic and manual process which worked well in the end.

In other software I was using, I was able to perform this task easily as the feature was included. It was more or less fill in the blanks.

I'm hoping the feature in implemented in the near future as it is becoming more of a requirement these days.

If you are desperate for a solution, I suggest you contact Mike Lodder at Sawtooth Software. I believe this is his area.

Apologies for not providing an ideal solution.
No worries. If I find a complete solution, I'll let you know. cheers
If the situation becomes desperate enough, I will be chasing a solution myself. I guess the next project that throws this issue at me will force me into it.

1 Answer

0 votes
Hi Paul,

You can use php within Sawtooth and implement mail functionality.

Reference: http://www.w3schools.com/php/func_mail_mail.asp

We have used this in one of our survey and it works perfectly.

Regards,
Saurabh
answered Aug 19, 2016 by Saurabh Aggarwal Gold (34,795 points)
Do you have a simple working example Saurabh?
Saurabh,

I had php installed on my server and was attempting to get this to work, but haven't been able to.  I followed the configuration instructions for the .ini file and set the path for the smtp mail server and the port.  In my program in the footer of a question I put in the below code.  Is there something you can point to that I'm missing?

<?php
$to = "jdrutherford2@hotmail.com";
$subject = "This is from Jay";
$txt = "First line of text\nSecond line of text";
$headers = "From: jruth@isgmn.com" . "\r\n" .
"CC: jruth@isgmn.com";

mail($to,$subject,$txt,$headers);
?>
Jay, I have put the request to Justin Luster to include the option of emailing with the additional feature of attaching survey results in a PDF or Excel file. This is a more common request these days. I'd love to see it implemented and I'm sure many users would enjoy the feature.
I do hope it is implemented.  Justin has spoken with me a little bit about different aspects of inclusion of that feature and possible concerns.  I know he had some ideas and sounded like they were working on it, just don't know how soon it would be available.  I was hoping to get the php solution working, but no luck yet.
...