Skip to content

Commit

Permalink
Add text-only support in html email handler
Browse files Browse the repository at this point in the history
  • Loading branch information
Facyla committed Dec 12, 2016
1 parent a771a2a commit 53b3e9a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
4 changes: 3 additions & 1 deletion mod/esope/lib/esope/html_email_handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
* - systematically strip HTML tags from text-only version.
*
* CHANGES :
* 1. Systematically strip tags from text version => in
* 1. Always add a text version
* 2. Systematically strip tags from text version
* 3. Add user settings for prefered version(s) ?
*/


Expand Down
14 changes: 12 additions & 2 deletions mod/esope/views/default/newsletter/view/body.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,19 @@
$email = get_input('e');
if ($email) {
$replacements['{newsletter_url}'] = $replacements['{newsletter_url}'] . '?e=' . $email;
$replacements['{unsublink}'] = newsletter_generate_unsubscribe_link($entity->getContainerEntity(), $email);
// ESOPE: avoid warning if container entity not accessible
if (elgg_instanceof($container_entity)) {
$replacements['{unsublink}'] = newsletter_generate_unsubscribe_link($container_entity, $email);
} else {
$replacements['{unsublink}'] = false;
}
} else {
$replacements['{unsublink}'] = newsletter_generate_unsubscribe_link($entity->getContainerEntity(), '');
// ESOPE: avoid warning if container entity not accessible
if (elgg_instanceof($container_entity)) {
$replacements['{unsublink}'] = newsletter_generate_unsubscribe_link($container_entity, '');
} else {
$replacements['{unsublink}'] = false;
}
}
}
}
Expand Down

0 comments on commit 53b3e9a

Please sign in to comment.