depending on the radio button selection users pick in my form, they will get a separate email message (template, if you will). i currently have it set up like this:
Code: Select all
require_once "_swift/lib/Swift.php";
require_once "_swift/lib/Swift/Connection/SMTP.php";
$swift =& new Swift(new Swift_Connection_SMTP("localhost"));
if($rdo_val == "string example one") {
$message =& new Swift_Message("subject one");
$message->attach(new Swift_Message_Part("<p>hello user, thanks for choosing " . $rdo_val . ".</p> <p>In nibh purus, feugiat ac, pellentesque eu, ornare sed, tortor. Praesent arcu " . $txt_one . " onec imperdiet egestas enim. Proin scelerisque " . $txt_two . " nisi ut leo. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vivamus</p> <img src=\"http://www.domain.tld/img/img-one.jpg\">","text/html"));
}
else if($rdo_val == "string example two") {
$message =& new Swift_Message("subject two");
$message->attach(new Swift_Message_Part("<p>hello user, thanks for choosing " . $rdo_val . ".</p> <p>In nibh purus, feugiat ac, pellentesque eu, ornare sed, tortor. Praesent arcu " . $txt_one . " onec imperdiet egestas enim. Proin scelerisque " . $txt_two . " nisi ut leo. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vivamus</p> <img src=\"http://www.domain.tld/img/img-two.jpg\">","text/html"));
}
Code: Select all
if($rdo_val == "string example one") {
$message =& new Swift_Message("subject one");
$message->attach(new Swift_Message_Part(new Swift_File("one.php"), "text/html")); //would i pass the variables in the Swift_File() function?
}
else if($rdo_val == "string example two") {
$message =& new Swift_Message("subject two");
$message->attach(new Swift_Message_Part(new Swift_File("two.php"), "text/html")); //would i pass the variables in the Swift_File() function?
}
i read the documentation but didn't see anything that mentioned whether i could do this. was i looking in the right spot?
is this even possible?