Skip to content

Commit

Permalink
Fixes setting from & from_name when form isn't saved to database.
Browse files Browse the repository at this point in the history
  • Loading branch information
dleffler committed Apr 15, 2011
1 parent 2383d2e commit 7bce2cd
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions modules/formbuilder/actions/submit_form.php
Expand Up @@ -81,12 +81,6 @@
$from_name = $user->firstname." ".$user->lastname." (".$user->username.")";
} else {
$db_data->user_id = 0;
if (empty($from)) {
$from = trim(SMTP_FROMADDRESS);
}
if (empty($from_name)) {
$from_name = trim(ORGANIZATION_NAME);
}
}
$db_data->timestamp = time();
}
Expand Down Expand Up @@ -124,6 +118,12 @@
$template->assign("is_email",1);
$emailHtml = $template->render();
$emailText = chop(strip_tags(str_replace(array("<br />","<br>","br/>"),"\n",$emailHtml)));
if (empty($from)) {
$from = trim(SMTP_FROMADDRESS);
}
if (empty($from_name)) {
$from_name = trim(ORGANIZATION_NAME);
}

if (count($emaillist)) {
//This is an easy way to remove duplicates
Expand Down

0 comments on commit 7bce2cd

Please sign in to comment.