Posts: 6
Threads: 1
Joined: Feb 2012
Reputation:
0
Thank you for the answer! My question was a bit indefinite, sorry. I want the email to be sent FROM the same address, IFuser leaves the email field empty in the form.
It's a job application form, and every applicant doesn't an have e-mail address. So if the forms e-mail field is empty, the sender name and address gets messed up in the email message. It shows two senders: firstname@my.server.com, lastname@my.server.com.
So I would need to tell the Form Tools this: if the applicant doesn't have an email address, use this address instead as FROM address: my@company.com (for example).
Posts: 2,456
Threads: 39
Joined: Dec 2008
Reputation:
6
Ah, I see!
Are you using the Swift Mailer module, btw, or the default mail functionality? Just wondering, because you shouldn't see two senders: it *should* just default to "none" in the absence of a valid email address, so I'll log this as a bug.
But in the meantime, you could do this with the Submission Pre-Parser module.
http://modules.formtools.org/submission_pre_parser/
1. Just install that module, then create a new rule called "Default email address".
2. For the "When Executed" option, select either the API or "On form submission" checkboxes, depending on your form type.
3. For the PHP code section, add the following code:
PHP Code:
<?php
if (empty($_POST["email"]))
{
$_POST["email"] = "my@company.com";
}
You'll need to tweak the $_POST["email"] to whatever field name your email field has.
And that should be it!
- Ben