block.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. /*
  3. * Name: Preheader
  4. * Section: header
  5. * Description: Preheader
  6. *
  7. */
  8. /* @var $options array */
  9. /* @var $wpdb wpdb */
  10. $default_options = array(
  11. 'view' => 'View online',
  12. 'text' => 'Few words summary',
  13. 'block_background' => '#ffffff',
  14. 'font_family' => $font_family,
  15. 'font_size' => 13,
  16. 'font_color' => '#999999',
  17. 'font_weight' => 'normal',
  18. 'block_padding_left'=>15,
  19. 'block_padding_right'=>15,
  20. 'block_padding_bottom'=>15,
  21. 'block_padding_top'=>15
  22. );
  23. $options = array_merge($default_options, $options);
  24. ?>
  25. <style>
  26. .preheader-table {
  27. width: 100%!important
  28. border: 0;
  29. border-collapse: collapse;
  30. }
  31. .preheader-link {
  32. padding: 10px;
  33. font-size: <?php echo $options['font_size'] ?>px;
  34. font-family: <?php echo $options['font_family'] ?>;
  35. font-weight: <?php echo $options['font_weight'] ?>;
  36. color: <?php echo $options['font_color'] ?>;
  37. }
  38. .preheader-view-link {
  39. font-size: <?php echo $options['font_size'] ?>px;
  40. font-family: <?php echo $options['font_family'] ?>;
  41. font-weight: <?php echo $options['font_weight'] ?>;
  42. color: <?php echo $options['font_color'] ?>;
  43. text-decoration: none;
  44. }
  45. </style>
  46. <table width="100%" border="0" cellpadding="0" align="center" cellspacing="0" inline-class="preheader-table">
  47. <tr>
  48. <td class="preheader-link" width="50%" valign="top" align="left">
  49. <?php echo $options['text'] ?>
  50. </td>
  51. <td class="preheader-link" width="50%" valign="top" align="right">
  52. <a href="{email_url}" target="_blank" rel="noopener" class="preheader-view-link"><?php echo $options['view'] ?></a>
  53. </td>
  54. </tr>
  55. </table>