| 1 | <?php |
|---|
| 2 | |
|---|
| 3 | // Writing HTML email is painful. Most of the popular email clients impose |
|---|
| 4 | // severe restrictions on your HTML and CSS code. |
|---|
| 5 | // |
|---|
| 6 | // At the time of writing this, Gmail strips all <style> tags, and all DOM IDs |
|---|
| 7 | // and CSS class names. This leaves us only with (repetitive) inline CSS. |
|---|
| 8 | // Don't rely on images showing up by default. Yahoo! Webmail blocks all |
|---|
| 9 | // images, including those embedded (i.e., attached) to the message. |
|---|
| 10 | // Tables seem to be the only reliable way of doing layouts. |
|---|
| 11 | // Check http://www.email-standards.org/ for more guide lines. |
|---|
| 12 | // |
|---|
| 13 | // If you plan on changing this template, please make sure to test it |
|---|
| 14 | // at least in Yahoo! Webmail, Gmail, and Hotmail. At the time of writing |
|---|
| 15 | // this (2009-01-19) they account for 87% of all our subscribers. |
|---|
| 16 | |
|---|
| 17 | log_assert_valid(user_validate($user)); |
|---|
| 18 | log_assert_valid(textblock_validate($textblock)); |
|---|
| 19 | log_assert(isset($body_html)); |
|---|
| 20 | log_assert(isset($subject)); |
|---|
| 21 | log_assert(isset($in_browser)); |
|---|
| 22 | log_assert(isset($user_is_anonymous)); |
|---|
| 23 | |
|---|
| 24 | ?> |
|---|
| 25 | <html> |
|---|
| 26 | <head> |
|---|
| 27 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
|---|
| 28 | <?php if ($in_browser) { ?> |
|---|
| 29 | <script type="text/javascript" src="<?= html_escape(url_static('js/config.js.php')) ?>"></script> |
|---|
| 30 | <script type="text/javascript" src="<?= html_escape(url_static('js/MochiKit.js')) ?>"></script> |
|---|
| 31 | <script type="text/javascript" src="<?= html_escape(url_static('js/newsletter.js')) ?>"></script> |
|---|
| 32 | <?php } ?> |
|---|
| 33 | </head> |
|---|
| 34 | <body> |
|---|
| 35 | <p> </p> |
|---|
| 36 | |
|---|
| 37 | <table width="100%" cellpadding="10" cellspacing="0" border="0" style="border:0"> |
|---|
| 38 | <tr><td valign="top" align="center" border="0" style="border:0"> |
|---|
| 39 | |
|---|
| 40 | <table width="550" cellpadding="0" cellspacing="0" class="layoutHeader" style="width:500px; border:2px solid #d9ffbe" border="0"> |
|---|
| 41 | <?php if (!$in_browser) { ?> |
|---|
| 42 | <tr><td style="background-color:#d9ffbe; text-align:left; border:0; padding:3px" align="left" |
|---|
| 43 | border="0" cellpadding="3" bgcolor="#dnffbe"> |
|---|
| 44 | <span style="font-size:8pt; line-height:200%; color:#006000; font-family:sans-serif; text-decoration:none;"> |
|---|
| 45 | Dacă acest email nu se afişează corect, te rugăm să îl |
|---|
| 46 | <a href="<?= html_escape(url_absolute(url_textblock($textblock['name']))) ?>" |
|---|
| 47 | style="color:#006000; text-decoration:underline;">vizualizezi în browser</a>.</span> |
|---|
| 48 | </td></tr> |
|---|
| 49 | <?php } else { ?> |
|---|
| 50 | <tr><td style="background-color:#d9ffbe; text-align:left; border:0" align="left" border="0" bgcolor="#dnffbe"> |
|---|
| 51 | <span style="font-size:8pt; line-height:200%; color:#006000; font-family:sans-serif; text-decoration:none;"> |
|---|
| 52 | <strong>Subiect:</strong> |
|---|
| 53 | <?= html_escape($subject) ?><br/> |
|---|
| 54 | <?php if (is_db_date($textblock['timestamp'])) { ?> |
|---|
| 55 | <strong>Data:</strong> |
|---|
| 56 | <?= html_escape(strftime('%Y-%m-%d', db_date_parse($textblock['creation_timestamp']))) ?><br/> |
|---|
| 57 | <?php } ?> |
|---|
| 58 | </span> |
|---|
| 59 | </td></tr> |
|---|
| 60 | <?php } ?> |
|---|
| 61 | <tr><td style="vertical-align:middle; padding:15pt 10pt 10pt 10pt; border:0; text-align:left" align="left" valign="middle" border="0" cellpadding="10"> |
|---|
| 62 | <a href="<?= html_escape(url_absolute(url_home())) ?>" style="font-size:25pt; color:#4a8f19; font-family:sans-serif; text-decoration:none;">info<em><i>arena</i></em></a> |
|---|
| 63 | </td></tr> |
|---|
| 64 | |
|---|
| 65 | <tr><td valign="top" style="font-size:10pt; color:#000000; line-height:150%; font-family:sans-serif; border:0; padding:5pt 15pt 15pt 15pt; text-align:left" cellpadding="15" border="0" align="left"> |
|---|
| 66 | <?= $body_html ?> |
|---|
| 67 | </td></tr> |
|---|
| 68 | |
|---|
| 69 | <tr><td style="background-color:#d0ffbe; text-align:left; border:0; padding:3px" |
|---|
| 70 | valign="top" align="left" border="0" cellpadding="3"> |
|---|
| 71 | <div style="font-size:8pt; color:#006000; line-height:150%; font-family:sans-serif;"> |
|---|
| 72 | |
|---|
| 73 | <?php if (!$in_browser) { ?> |
|---|
| 74 | |
|---|
| 75 | <p>Ai primit acest mesaj deoarece eşti înscris pe |
|---|
| 76 | <a href="<?= html_escape(url_absolute(url_home())) ?>" style="color:#006000; text-decoration:underline"> |
|---|
| 77 | infoarena</a> cu numele <em><?= html_escape($user['full_name']) ?></em>, |
|---|
| 78 | utilizator <em><?= html_escape($user['username']) ?></em>, |
|---|
| 79 | adresă de email <em><?= html_escape($user['email']) ?></em>.</p> |
|---|
| 80 | |
|---|
| 81 | <p>Dacă nu mai doreşti să primeşti astfel de mesaje |
|---|
| 82 | <a style="color:#006000; text-decoration:underline" |
|---|
| 83 | href="<?= html_escape(url_absolute(url_unsubscribe($user['username'], user_unsubscribe_key($user)))) ?>"> |
|---|
| 84 | dezabonează-te acum</a>.</p> |
|---|
| 85 | |
|---|
| 86 | <?php } else if (!$user_is_anonymous) { ?> |
|---|
| 87 | |
|---|
| 88 | <p>Eşti înscris pe |
|---|
| 89 | <a href="<?= html_escape(url_absolute(url_home())) ?>" |
|---|
| 90 | style="color:#006000; text-decoration:underline"> |
|---|
| 91 | infoarena</a> cu numele <em><?= html_escape($user['full_name']) ?></em>, |
|---|
| 92 | utilizator <em><?= html_escape($user['username']) ?></em>, |
|---|
| 93 | adresă de email <em><?= html_escape($user['email']) ?></em>.</p> |
|---|
| 94 | |
|---|
| 95 | <p>Dacă nu mai doreşti să primeşti astfel de mesaje în viitor, |
|---|
| 96 | <a style="color:#006000; text-decoration:underline" |
|---|
| 97 | href="<?= url_absolute(url_account()) ?>">modifică opţiunile contului tău</a>.</p> |
|---|
| 98 | |
|---|
| 99 | <?php } else { ?> |
|---|
| 100 | |
|---|
| 101 | <p>infoarena nu trimite mesaje nesolicitate. Acest mesaj a fost trimis |
|---|
| 102 | pe email membrilor infoarena abonaţi la newsletter.</p> |
|---|
| 103 | |
|---|
| 104 | <p>Dacă nu mai doreşti să primeşti astfel de mesaje în viitor, |
|---|
| 105 | <a style="color:#006000; text-decoration:underline" |
|---|
| 106 | href="<?= url_absolute(url_account()) ?>">modifică opţiunile contului tău</a>.</p> |
|---|
| 107 | |
|---|
| 108 | <?php } ?> |
|---|
| 109 | |
|---|
| 110 | </div> |
|---|
| 111 | </td></tr> |
|---|
| 112 | </table> |
|---|
| 113 | |
|---|
| 114 | </td></tr> |
|---|
| 115 | </table> |
|---|
| 116 | </body> |
|---|
| 117 | </html> |
|---|