Back to Mailgun Endpoint Support

jriley
jriley

Hello!

I've found Mailgun Endpoint to be very useful. However, I had to make a couple of adjustments to get the latest installation working. I've listed them out below - I'm not sure if others have had any of these issues, so I just wanted to provide them in case they are helpful.

1. Duplicate Content in /update

I had to fix controllers/mailgunnotifications/update.htm - there was a line commented out that rendered the contents of a notification, but depending on the message content, it could have rendered anyway.

Original:

= $this->formRenderPreview() ?>

Updated to:

= $this->formRenderPreview() ?>

2. Datepicker list / form in backend

The original files columns.yaml and fields.yaml within /models/mailgunnotification/ that came with the plugin threw an error when attempting to view the main page in the backend, or view a specific notification. I'm not sure if that's a problem with the plugin, but I had to use 'date' type.

Original:
type: datepicker

Updated to:
type: date

3. Fix issue with body-html error

Some types of mail content don't include body-html within the message. The file classes/Notification.php had to be modified to check whether the key body-html exists within the array first. This might be an issue with other fields too, depending on the mail client.

Original:
public function __construct(array $mailgunNotification = [])
...
...
$this->bodyRaw = $mailgunNotification['body-plain'];

Updated to:
public function __construct(array $mailgunNotification = [])
...
...
if (array_key_exists('body-html', $mailgunNotification)) {
$this->bodyHtml = $mailgunNotification['body-html'];
}

else {
$this->bodyHtml = '';
}

Last updated

1-1 of 1