Mail: Add option to remove LD+JSON header in e-mails for users with e-mail clients that do not support it - refs #3917

pull/4289/head
Yannick Warnier 4 years ago committed by GitHub
parent 53e8115824
commit 4eedf7de10
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      app/config/mail.conf.dist.php
  2. 1
      main/inc/lib/api.lib.php
  3. 2
      main/template/default/mail/mail.tpl

@ -37,3 +37,7 @@ $platform_email['DKIM_SELECTOR'] = 'chamilo'; // an indicator of the application
$platform_email['DKIM_DOMAIN'] = 'mydomain.com'; //the domain for e-mail sending, not necessarily api_get_path(WEB_PATH)
$platform_email['DKIM_PRIVATE_KEY_STRING'] = ''; //the private key in a string format
$platform_email['DKIM_PRIVATE_KEY'] = ''; //the private key as the path to a file. The file needs to be accessible to PHP!
// Some e-mail clients do not understand the descriptive LD+JSON format,
// showing it as a loose JSON string to the final user. If this is your case,
// you might want to set the variable below to 'false' to disable this header.
$platform_email['EXCLUDE_JSON'] = false;

@ -9379,6 +9379,7 @@ function api_mail_html(
}
$mailView->assign('mail_header_style', api_get_configuration_value('mail_header_style'));
$mailView->assign('mail_content_style', api_get_configuration_value('mail_content_style'));
$mailView->assign('include_ldjson', (empty($platform_email['EXCLUDE_JSON']) ? true : false));
$layout = $mailView->get_template('mail/mail.tpl');
$mail->Body = $mailView->fetch($layout);

@ -4,6 +4,7 @@
<title>{{ _s.institution }}</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
{% if include_ldjson %}
<script type="application/ld+json">
{
"@context": "http://schema.org",
@ -15,6 +16,7 @@
}
}
</script>
{% endif %}
</head>
<body style="background-color: #f6f6f6; font-family: sans-serif; -webkit-font-smoothing: antialiased; font-size: 14px; line-height: 1.4; margin: 0; padding: 0; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%;">
<table border="0" cellpadding="0" cellspacing="0" class="body" style="border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%; background-color: #f6f6f6;">

Loading…
Cancel
Save