Skip to content

Commit

Permalink
Issue #52: Update backdrop_mail implementation to respect 'from' param.
Browse files Browse the repository at this point in the history
  • Loading branch information
laryn authored Jan 31, 2025
1 parent e985b1f commit 64e6509
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
6 changes: 4 additions & 2 deletions includes/registration.forms.inc
Original file line number Diff line number Diff line change
Expand Up @@ -393,11 +393,13 @@ function registration_send_confirmation($form, &$form_state) {
'subject' => $subject,
'message' => $message,
);
if (!empty($settings['settings']['from_address'])) {
$params['from'] = $settings['settings']['from_address'];
}
global $language;
$from = $settings['settings']['from_address'];

// Send the confirmation email.
backdrop_mail('registration', 'confirmation', $email, $language, $params, $from);
backdrop_mail('registration', 'confirmation', $email, $language, $params);
}
}
}
Expand Down
7 changes: 3 additions & 4 deletions registration.module
Original file line number Diff line number Diff line change
Expand Up @@ -1202,7 +1202,7 @@ function registration_send_broadcast($entity_type, $entity_id, $subject, $messag

// grab registration entity settings
$settings = registration_entity_settings($entity_type, $entity_id);
$from = $settings['settings']['from_address'];
$from = $settings['settings']['from_address'] ? $settings['settings']['from_address'] : '';

// grab all registrations
$query = new EntityFieldQuery();
Expand Down Expand Up @@ -1256,10 +1256,9 @@ function registration_send_broadcast($entity_type, $entity_id, $subject, $messag
);
$message = token_replace($message_template, $data, array('clear' => TRUE));
$params['message'] = $message;
$params['from'] = $from;

$result = backdrop_mail('registration', 'broadcast',
$wrapper->mail->value(), $language, $params, $from
);
$result = backdrop_mail('registration', 'broadcast', $wrapper->mail->value(), $language, $params);
if ($result['result'] !== FALSE) {
$success_count++;
}
Expand Down

0 comments on commit 64e6509

Please sign in to comment.