Skip to content

Commit

Permalink
Improve dashboard examples.
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Theken committed Mar 25, 2016
1 parent 1f46637 commit 04fb19c
Showing 1 changed file with 28 additions and 40 deletions.
68 changes: 28 additions & 40 deletions page-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,60 +91,23 @@
<td>
<input type="text" class="pm-sender-address" value="" />
<div class="footnote">This email must be a verified <a href="https://account.postmarkapp.com/signatures" target="_blank">Sender Signature</a>. It will appear as the "from" address on all outbound emails.<br/><br/>
You may override the "From" address set here on individual emails, by including a 'From' header with the address you wish to send from. This address must still be a confirmed Sender Signature associated with your account on Postmark.
<h6>Example Override:</h6>
<pre>
$headers = array();
$headers['From'] = 'some_other_address@example.com';
// send mail
$response = wp_mail( $to, $subject, $message, $headers );
</pre>
<br/><br/>
For more information on setting headers using the wp_mail function, <a href="https://developer.wordpress.org/reference/functions/wp_mail/">see the Wordpress Codex page.</a>
You may override the "From" address set here on individual emails, by including a 'From' header with the address you wish to send from. <a href="#example">See the example below.</a>
</div>
</td>
</tr>
<tr>
<th><label>Force HTML</label></th>
<td>
<input type="checkbox" class="pm-force-html" value="1" />
<span class="footnote">Force emails to be sent as HTML.<br/><br/>DEPRECATED: Instead of enabling this feature, add a header to your HTML message with name 'Content-Type' and value 'text/html'. See the example below.
<span class="footnote">Force emails to be sent as HTML.<br/><br/>DEPRECATED: Instead of enabling this feature, add a header to your HTML message with name 'Content-Type' and value 'text/html'. <a href="#example">See the example below.</a>
</span>
</td>
</tr>
<tr>
<th><label>Track Opens</label></th>
<td>
<input type="checkbox" class="pm-track-opens" value="1" />
<span class="footnote">Track email opens (which also requires emails to be "forced" to HTML).<br/><br/>DEPRECATED: Instead of enabling this feature, add a header to your HTML message called 'X-PM-Track-Opens' and a value of 'true'. See the example below.
</td>
</tr>
<tr>
<td colspan="2">
<h2>Overriding Sending Behavior for Individual Messages:</h2>
"Forcing HTML" for Wordpress-generated emails (such as password reset emails) will cause them to be sent as HTML, this is often incorrect. Instead, individual messages should include the header above to have them treated as HTML instead of plain text

<h4>Example Overrides:</h4>
<pre>
//Create a headers array:
$headers = array();

// Set this header if you want to override the default 'From' address:
$headers['From'] = 'john.smith@example.com';

// Set this header if you want the message to be sent as HTML.
$headers['Content-Type'] = 'text/html';

// Set this header if you want to enable open tracking for this message.
// Setting this header also forces the message to be treated as HTML.
$headers['X-PM-Track-Opens'] = true;

// Send the email, including the $headers array we just created:
$response = wp_mail( $to, $subject, $message, $headers );

</pre>
<br/><br/>
For more information on setting headers using the wp_mail function, <a href="https://developer.wordpress.org/reference/functions/wp_mail/">see the Wordpress Codex page.</a>
<span class="footnote">Track email opens (which also requires emails to be "forced" to HTML).<br/><br/>DEPRECATED: Instead of enabling this feature, add a header to your HTML message called 'X-PM-Track-Opens' and a value of 'true'. <a href="#example">See the example below.</a>
</td>
</tr>
</table>
Expand All @@ -171,4 +134,29 @@
<div class="submit">
<input type="submit" class="button-primary send-test" value="Send Test Email" />
</div>
<div style="max-width:740px;" id="example">
<h2>Overriding Sending Behavior for Individual Messages:</h2>
"Forcing HTML" for Wordpress-generated emails (such as password reset emails) will cause them to be sent as HTML, this is often incorrect. Instead, individual messages should include the header above to have them treated as HTML instead of plain text

<h4>Example Overrides:</h4>
<pre>
//Create a headers array:
$headers = array();

// Set this header if you want to override the default 'From' address:
$headers['From'] = 'john.smith@example.com';

// Set this header if you want the message to be sent as HTML.
$headers['Content-Type'] = 'text/html';

// Set this header if you want to enable open tracking for this message.
// Setting this header also forces the message to be treated as HTML.
$headers['X-PM-Track-Opens'] = true;

// Send the email, including the $headers array we just created:
$response = wp_mail( $to, $subject, $message, $headers );

</pre>
For more information on setting headers using the wp_mail function, <a href="https://developer.wordpress.org/reference/functions/wp_mail/">see the Wordpress Codex page.</a>
</div>
</div>

0 comments on commit 04fb19c

Please sign in to comment.