Skip to content

Commit

Permalink
campaignion_action: Reduce logging of missing email addresses
Browse files Browse the repository at this point in the history
When a form doesn’t have an email field, we should not generate a log
message for each submission, that complains about that.
  • Loading branch information
torotil committed Jul 5, 2022
1 parent 20d3216 commit 4b7dfc3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion campaignion_action/campaignion_action.module
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,11 @@ function campaignion_action_campaignion_action_taken($node, Submission $submissi
$contact = $importer->findOrCreateContact($submission);
}
catch (NoEmailException $e) {
// Log the missing email address.
// If the form doesn’t have an email field, this is expected. Don’t log.
if (!$submission->webform->componentByKey('email')) {
return;
}
// Log that the email address was missing.
$ids = $submission->ids();
$args = array('@nid' => $ids['nid'], '@sid' => $ids['sid']);
$msg = "Can't import supporter without email-address for Submission(@nid, @sid).";
Expand Down

0 comments on commit 4b7dfc3

Please sign in to comment.