Problem/Motivation

Extra email is sent without body which triggers an error message: "Unable to send email. Contact the site administrator if the problem persists.".

Proposed resolution

Fetch email message with send parameter set to FALSE.

In line 31 of InviteByEmail.php the mail message is fetched by calling the mail plugin and the ->mail function without the send parameter set to false which triggers an extra email to be sent.

$message = $mail->mail('invite_by_email', $mail_key, $invite->get('field_invite_email_address')->value, $invite->activeLangcode, array(), $invite->getOwner()->getEmail());

Which should be:

$message = $mail->mail('invite_by_email', $mail_key, $invite->get('field_invite_email_address')->value, $invite->activeLangcode, array(), $invite->getOwner()->getEmail(), FALSE);
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

pontus_nilsson created an issue. See original summary.

pontus_nilsson’s picture

pontus_nilsson’s picture

Status: Active » Needs review
rahul.nahar001’s picture

Hi @pontus_nilsson,

I am not able to apply provided patch file. Getting below-mentioned errors.

Checking patch modules/invite_by_email/src/Plugin/Invite/InviteByEmail.php...
error: while searching for:
    $system->mail($message);
  }

}
error: patch failed: modules/invite_by_email/src/Plugin/Invite/InviteByEmail.php                                                                                                                :52
error: modules/invite_by_email/src/Plugin/Invite/InviteByEmail.php: patch does n                                                                                                                ot apply

Thanks

rahul.nahar001’s picture

Status: Needs review » Needs work
rahul.nahar001’s picture

Status: Needs work » Needs review
FileSize
804 bytes

Hello @pontus_nilsson,

Please find updated Patch.

pontus_nilsson’s picture

Status: Needs review » Reviewed & tested by the community
renatog’s picture

Assigned: Unassigned » renatog
Issue tags: +ciandt-contrib

Thank you very much for contributions @pontus_nilsson and @rahulnahar001.

renatog’s picture

Assigned: renatog » Unassigned
Status: Reviewed & tested by the community » Fixed

Fixed.

Commited in dev branch.

Thank you very much mans.

Good Work and Good Weekend.

Regards.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.