WP Better Emails - Version 0.2.5

Version Description

  • Added plain text template support
  • Fixed phpmailer_init action
  • Brazilian portuguese translation added
Download this release

Release Info

Developer nlemoine
Plugin Icon 128x128 WP Better Emails
Version 0.2.5
Comparing to
See all releases

Code changes from version 0.2.4.1 to 0.2.5

js/wpbe-admin-script.js CHANGED
@@ -25,7 +25,7 @@ jQuery(document).ready(function($){
25
  });
26
 
27
  // Trigger help
28
- $('#wpbe_help').bind('click', function(e){
29
  e.preventDefault();
30
  $('a#contextual-help-link').trigger('click');
31
  });
25
  });
26
 
27
  // Trigger help
28
+ $('.wpbe_help').bind('click', function(e){
29
  e.preventDefault();
30
  $('a#contextual-help-link').trigger('click');
31
  });
langs/wp-better-emails-fr_FR.mo CHANGED
Binary file
langs/wp-better-emails-fr_FR.po CHANGED
@@ -4,193 +4,283 @@ msgid ""
4
  msgstr ""
5
  "Project-Id-Version: WP Better Emails\n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/wp-better-emails\n"
7
- "POT-Creation-Date: 2011-09-06 23:22:41+00:00\n"
 
 
 
 
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
- "PO-Revision-Date: 2011-09-12 17:26+0100\n"
12
- "Last-Translator: \n"
13
- "Language-Team: Nicolas Lemoine <plugins@artyshow-studio.fr>\n"
14
- "X-Poedit-Language: French\n"
15
 
16
- #: wpbe-options.php:2
17
- #: wpbe.php:158
18
  msgid "Email settings"
19
  msgstr "Configuration des emails"
20
 
21
- #: wpbe-options.php:9
22
- msgid "Set your own sender name and email address. Default Wordpress values will be used if empty."
23
- msgstr "Définissez votre propre nom d'envoyeur et adresse email d'envoyeur. Les valeurs par défaut de Wordpress seront utilisées si les champs sont laissés vides."
24
 
25
- #: wpbe-options.php:12
 
 
 
 
 
 
 
 
 
26
  msgid "Name"
27
  msgstr " Nom"
28
 
29
- #: wpbe-options.php:16
30
  msgid "Email address"
31
  msgstr "Adresse email"
32
 
33
- #: wpbe-options.php:22
34
  msgid "HTML Template"
35
  msgstr "Modèle HTML"
36
 
37
- #: wpbe-options.php:24
38
  msgid "Live template preview"
39
  msgstr "Aperçu rapide du modèle"
40
 
41
- #: wpbe-options.php:24
42
  msgid "Live preview"
43
  msgstr "Aperçu"
44
 
45
- #: wpbe-options.php:26
46
- msgid "Edit the HTML email template if you want to customize it. You might have a look at the <a href=\"#\" id=\"wpbe_help\">help tab</a> for further information."
47
- msgstr "Editer le modèle HTML si vous souhaitez le personnaliser. <a href=\"#\" id=\"wpbe_help\">Consultez l'aide</a> pour plus d'information."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48
 
49
- #: wpbe-options.php:35
50
  msgid "Send an email preview to"
51
  msgstr "Envoyer un aperçu à"
52
 
53
- #: wpbe-options.php:39
54
  msgid "Send"
55
  msgstr "Envoyer"
56
 
57
- #: wpbe-options.php:41
58
  msgid "You must save your template before sending an email preview."
59
  msgstr "Vous devez enregistrer le modèle avant d'envoyer un aperçu."
60
 
61
- #: wpbe-options.php:46
62
  msgid "Save Changes"
63
  msgstr "Enregistrer les modifications"
64
 
65
- #: wpbe-options.php:52
66
  msgid "Support & bug report"
67
  msgstr "Support & report de bugs"
68
 
69
- #: wpbe-options.php:53
70
- msgid "If you have any idea to improve this plugin or any bug to report, please email me at : <a href=\"mailto:plugins@artyshow-studio.fr?subject=[wp-better-emails]\">plugins@artyshow-studio.fr</a>"
71
- msgstr "Si vous avez des idées d'amélioration ou des bugs à mentionner, envoyez-moi un email à <a href=\"mailto:plugins@artyshow-studio.fr?subject=[wp-better-emails]\">plugins@artyshow-studio.fr</a>"
72
-
73
- #: wpbe-options.php:55
74
- msgid "You like this plugin ? You use it in a business context ? Please, consider a <a href=\"%s\" target=\"_blank\" rel=\"external\">donation</a>."
75
- msgstr "Vous aimez ce plugin ? Vous l'utilisez dans un contexte professionnel ? Considérez un <a href=\"%s\" target=\"_blank\" rel=\"external\">don</a>."
76
-
77
- #: templates/template-1.php:33
78
- msgid "Date"
79
- msgstr "Date"
80
-
81
- #: templates/template-1.php:33
82
- msgid "Email sent"
83
- msgstr "Email envoyé le"
84
-
85
- #: templates/template-1.php:34
86
- msgid "Contact"
87
- msgstr "Contact"
88
 
89
- #: templates/template-1.php:34
90
- msgid "For any requests, please contact"
91
- msgstr "Pour toute demande, contactez"
 
 
 
 
 
92
 
93
- #: wpbe.php:131
94
  msgid "Settings"
95
  msgstr "Configuration"
96
 
97
- #: wpbe.php:147
98
  msgid "WP Better Emails requires WordPress 2.8 or newer."
99
  msgstr "WP Better Emails requiert Wordpress 2.8 ou une version plus récente."
100
 
101
- #: wpbe.php:147
102
  msgid "Upgrade your Wordpress installation."
103
  msgstr "Mettez à jour votre installation de Wordpress."
104
 
105
- #: wpbe.php:158
106
  msgid "WP Better Emails"
107
  msgstr "WP Better Emails"
108
 
109
- #: wpbe.php:228
110
  msgid "Please enter a valid sender email address."
111
  msgstr "Veuillez entrer une adresse email valide pour l'envoyeur."
112
 
113
- #: wpbe.php:238
114
  msgid "Template is empty"
115
  msgstr "Le modèle est vide"
116
 
117
- #: wpbe.php:241
118
  msgid "No content tag found. The %content% tag is required in your template"
119
- msgstr "Aucun tag de contenu n'a été trouvé. Veuillez insérer le tag %content% dans votre template."
 
 
120
 
121
- #: wpbe.php:259
 
 
 
 
 
 
 
 
 
 
 
 
122
  msgid "Please enter an email"
123
  msgstr "Veuillez entrer un email"
124
 
125
- #: wpbe.php:261
126
  msgid "Please enter a valid email"
127
  msgstr "Veuillez entrer un email valide"
128
 
129
- #: wpbe.php:262
130
  msgid "Hey !"
131
  msgstr "Hey !"
132
 
133
- #: wpbe.php:264
134
  msgid "This is a sample email to test your HTML template."
135
  msgstr "Ceci un email factice pour tester votre modèle."
136
 
137
- #: wpbe.php:266
138
- msgid "If you're not skilled in HTML/CSS email coding, I strongly recommend to leave the default template as it is. It has been tested on various and popular email clients like Gmail, Yahoo Mail, Hotmail/Live, Thunderbird, Apple Mail, Outlook, and many more."
139
- msgstr "Si vous n'êtes pas compétent en intégraiton HTML/CSS, je vous recommande vivement de laisser le modèle tel qu'il est. Il a été testé sur de nombreux et populaires clients mail comme Gmail, Yahoo Mail, Hotmail/Live, Thunderbird, Apple Mail, Outlook, et bien plus encore."
 
 
 
 
 
 
 
 
140
 
141
- #: wpbe.php:268
142
- msgid "If you have any problems or any suggestions to improve this plugin, please let me know."
143
- msgstr "Si vous recontrez un problèmes ou des suggestions d'améliorations, n'hésitez pas à m'en faire part."
 
 
 
 
144
 
145
- #: wpbe.php:269
146
  msgid "Email template preview"
147
  msgstr "Aperçu du modèle d'email"
148
 
149
- #: wpbe.php:270
 
150
  msgid "An email preview has been successfully sent to %s"
151
  msgstr "Un email d'aperçu vient d'être envoyé avec succès à %s"
152
 
153
- #: wpbe.php:273
154
- msgid "An error occured while sending email. Please check your server configuration."
155
- msgstr "Une erreur a eu lieu lors de l'envoi. Vérifiez la configuration de votre serveur."
 
 
 
156
 
157
- #: wpbe.php:410
158
  msgid "Some dynamic tags can be included in your email template :"
159
  msgstr "Des tags dynamiques peuvent être inclus dans votre template :"
160
 
161
- #: wpbe.php:412
162
  msgid "<strong>%content%</strong> : will be replaced with the message content."
163
  msgstr "<strong>%content%</strong> : sera remplacé par le contenu du message."
164
 
165
- #: wpbe.php:413
166
- msgid "NOTE: The content tag is <strong>required</strong>, WP Better Emails will be automatically desactivated if no content tag is found."
167
- msgstr "NOTE: Le tag \"content\" est <strong>requis</strong>, WP Better Emails sera automatiquement désactivé si ce tag n'est pas trouvé dans le modèle."
 
 
 
 
168
 
169
- #: wpbe.php:414
170
  msgid "<strong>%blog_url%</strong> : will be replaced with your blog URL."
171
  msgstr "<strong>%blog_url%</strong> : sera remplacé par l'URL de votre blog."
172
 
173
- #: wpbe.php:415
174
  msgid "<strong>%home_url%</strong> : will be replaced with your home URL."
175
- msgstr "<strong>%home_url%</strong> : sera remplacé par l'URL d'accueil de votre blog."
 
 
176
 
177
- #: wpbe.php:416
178
  msgid "<strong>%blog_name%</strong> : will be replaced with your blog name."
179
  msgstr "<strong>%blog_name%</strong> : sera remplacé par le nom de votre blog."
180
 
181
- #: wpbe.php:417
182
- msgid "<strong>%blog_description%</strong> : will be replaced with your blog description."
183
- msgstr "<strong>%blog_description%</strong> : sera remplacé par la description de votre blog."
 
 
 
 
184
 
185
- #: wpbe.php:418
186
  msgid "<strong>%admin_email%</strong> : will be replaced with admin email."
187
- msgstr "<strong>%admin_email%</strong> : sera remplacé par l'email de l'administrateur."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
188
 
189
- #: wpbe.php:419
190
- msgid "<strong>%date%</strong> : will be replaced with current date, as formatted in <a href=\"options-general.php\">general options</a>."
191
- msgstr "<strong>%date%</strong> : sera remplacé par la date courante, telle que formatée dans les <a href=\"options-general.php\">options générales</a>."
192
 
193
- #: wpbe.php:420
194
- msgid "<strong>%time%</strong> : will be replaced with current time, as formatted in <a href=\"options-general.php\">general options</a>."
195
- msgstr "<strong>%time%</strong> : sera remplacé par l'heure courante, telle que formatée dans les <a href=\"options-general.php\">options générales</a>."
196
 
 
 
 
4
  msgstr ""
5
  "Project-Id-Version: WP Better Emails\n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/wp-better-emails\n"
7
+ "POT-Creation-Date: 2013-04-08 14:50+0100\n"
8
+ "PO-Revision-Date: 2013-04-08 14:51+0100\n"
9
+ "Last-Translator: \n"
10
+ "Language-Team: Nicolas Lemoine <plugins@artyshow-studio.fr>\n"
11
+ "Language: fr\n"
12
  "MIME-Version: 1.0\n"
13
  "Content-Type: text/plain; charset=UTF-8\n"
14
  "Content-Transfer-Encoding: 8bit\n"
15
+ "X-Generator: Poedit 1.5.5\n"
 
 
 
16
 
17
+ #: ../wpbe-options.php:2 ../wpbe.php:186
 
18
  msgid "Email settings"
19
  msgstr "Configuration des emails"
20
 
21
+ #: ../wpbe-options.php:8
22
+ msgid "Sender Options"
23
+ msgstr "Options d'envoi"
24
 
25
+ #: ../wpbe-options.php:9
26
+ msgid ""
27
+ "Set your own sender name and email address. Default WordPress values will be "
28
+ "used if empty."
29
+ msgstr ""
30
+ "Définissez votre propre nom d'envoyeur et adresse email d'envoyeur. Les "
31
+ "valeurs par défaut de Wordpress seront utilisées si les champs sont laissés "
32
+ "vides."
33
+
34
+ #: ../wpbe-options.php:12
35
  msgid "Name"
36
  msgstr " Nom"
37
 
38
+ #: ../wpbe-options.php:16
39
  msgid "Email address"
40
  msgstr "Adresse email"
41
 
42
+ #: ../wpbe-options.php:22
43
  msgid "HTML Template"
44
  msgstr "Modèle HTML"
45
 
46
+ #: ../wpbe-options.php:24
47
  msgid "Live template preview"
48
  msgstr "Aperçu rapide du modèle"
49
 
50
+ #: ../wpbe-options.php:24
51
  msgid "Live preview"
52
  msgstr "Aperçu"
53
 
54
+ #: ../wpbe-options.php:27
55
+ msgid ""
56
+ "Edit the HTML template if you want to customize it. You might have a look at "
57
+ "the <a href=\"#\" class=\"wpbe_help\">help tab</a> for further information."
58
+ msgstr ""
59
+ "Editer le modèle HTML si vous souhaitez le personnaliser. <a href=\"#\" id="
60
+ "\"wpbe_help\">Consultez l'aide</a> pour plus d'information."
61
+
62
+ #: ../wpbe-options.php:33
63
+ msgid "Plain-text Template"
64
+ msgstr "Modèle version texte"
65
+
66
+ #: ../wpbe-options.php:34
67
+ msgid ""
68
+ "Edit the plain-text template if you want to customize it. You might have a "
69
+ "look at the <a href=\"#\" class=\"wpbe_help\">help tab</a> for further "
70
+ "information."
71
+ msgstr ""
72
+ "Editer le modèle texte si vous souhaitez le personnaliser. <a href=\"#\" id="
73
+ "\"wpbe_help\">Consultez l'aide</a> pour plus d'information."
74
+
75
+ #: ../wpbe-options.php:40
76
+ msgid "Preview"
77
+ msgstr "Aperçu"
78
 
79
+ #: ../wpbe-options.php:45
80
  msgid "Send an email preview to"
81
  msgstr "Envoyer un aperçu à"
82
 
83
+ #: ../wpbe-options.php:49
84
  msgid "Send"
85
  msgstr "Envoyer"
86
 
87
+ #: ../wpbe-options.php:51
88
  msgid "You must save your template before sending an email preview."
89
  msgstr "Vous devez enregistrer le modèle avant d'envoyer un aperçu."
90
 
91
+ #: ../wpbe-options.php:56
92
  msgid "Save Changes"
93
  msgstr "Enregistrer les modifications"
94
 
95
+ #: ../wpbe-options.php:61
96
  msgid "Support & bug report"
97
  msgstr "Support & report de bugs"
98
 
99
+ #: ../wpbe-options.php:62
100
+ msgid ""
101
+ "If you have any idea to improve this plugin or any bug to report, please "
102
+ "email me at : <a href=\"mailto:plugins@artyshow-studio.fr?subject=[wp-better-"
103
+ "emails]\">plugins@artyshow-studio.fr</a>"
104
+ msgstr ""
105
+ "Si vous avez des idées d'amélioration ou des bugs à mentionner, envoyez-moi "
106
+ "un email à <a href=\"mailto:plugins@artyshow-studio.fr?subject=[wp-better-"
107
+ "emails]\">plugins@artyshow-studio.fr</a>"
 
 
 
 
 
 
 
 
 
 
108
 
109
+ #: ../wpbe-options.php:64
110
+ #, php-format
111
+ msgid ""
112
+ "You like this plugin ? You use it in a business context ? Please, consider a "
113
+ "<a href=\"%s\" target=\"_blank\" rel=\"external\">donation</a>."
114
+ msgstr ""
115
+ "Vous aimez ce plugin ? Vous l'utilisez dans un contexte professionnel ? "
116
+ "Considérez un <a href=\"%s\" target=\"_blank\" rel=\"external\">don</a>."
117
 
118
+ #: ../wpbe.php:156
119
  msgid "Settings"
120
  msgstr "Configuration"
121
 
122
+ #: ../wpbe.php:174
123
  msgid "WP Better Emails requires WordPress 2.8 or newer."
124
  msgstr "WP Better Emails requiert Wordpress 2.8 ou une version plus récente."
125
 
126
+ #: ../wpbe.php:174
127
  msgid "Upgrade your Wordpress installation."
128
  msgstr "Mettez à jour votre installation de Wordpress."
129
 
130
+ #: ../wpbe.php:186
131
  msgid "WP Better Emails"
132
  msgstr "WP Better Emails"
133
 
134
+ #: ../wpbe.php:263
135
  msgid "Please enter a valid sender email address."
136
  msgstr "Veuillez entrer une adresse email valide pour l'envoyeur."
137
 
138
+ #: ../wpbe.php:276
139
  msgid "Template is empty"
140
  msgstr "Le modèle est vide"
141
 
142
+ #: ../wpbe.php:280
143
  msgid "No content tag found. The %content% tag is required in your template"
144
+ msgstr ""
145
+ "Aucun tag de contenu n'a été trouvé. Veuillez insérer le tag %content% dans "
146
+ "votre template."
147
 
148
+ #: ../wpbe.php:289
149
+ msgid "Plain-text template is empty"
150
+ msgstr "Le modèle est vide"
151
+
152
+ #: ../wpbe.php:293
153
+ msgid ""
154
+ "No content tag found. The %content% tag is required in your plain-text "
155
+ "template"
156
+ msgstr ""
157
+ "Aucun tag de contenu n'a été trouvé. Veuillez insérer le tag %content% dans "
158
+ "votre template."
159
+
160
+ #: ../wpbe.php:317
161
  msgid "Please enter an email"
162
  msgstr "Veuillez entrer un email"
163
 
164
+ #: ../wpbe.php:320
165
  msgid "Please enter a valid email"
166
  msgstr "Veuillez entrer un email valide"
167
 
168
+ #: ../wpbe.php:323
169
  msgid "Hey !"
170
  msgstr "Hey !"
171
 
172
+ #: ../wpbe.php:325
173
  msgid "This is a sample email to test your HTML template."
174
  msgstr "Ceci un email factice pour tester votre modèle."
175
 
176
+ #: ../wpbe.php:327
177
+ msgid ""
178
+ "If you're not skilled in HTML/CSS email coding, I strongly recommend to "
179
+ "leave the default template as it is. It has been tested on various and "
180
+ "popular email clients like Gmail, Yahoo Mail, Hotmail/Live, Thunderbird, "
181
+ "Apple Mail, Outlook, and many more."
182
+ msgstr ""
183
+ "Si vous n'êtes pas compétent en intégraiton HTML/CSS, je vous recommande "
184
+ "vivement de laisser le modèle tel qu'il est. Il a été testé sur de nombreux "
185
+ "et populaires clients mail comme Gmail, Yahoo Mail, Hotmail/Live, "
186
+ "Thunderbird, Apple Mail, Outlook, et bien plus encore."
187
 
188
+ #: ../wpbe.php:329
189
+ msgid ""
190
+ "If you have any problems or any suggestions to improve this plugin, please "
191
+ "let me know."
192
+ msgstr ""
193
+ "Si vous recontrez un problèmes ou des suggestions d'améliorations, n'hésitez "
194
+ "pas à m'en faire part."
195
 
196
+ #: ../wpbe.php:333
197
  msgid "Email template preview"
198
  msgstr "Aperçu du modèle d'email"
199
 
200
+ #: ../wpbe.php:334
201
+ #, php-format
202
  msgid "An email preview has been successfully sent to %s"
203
  msgstr "Un email d'aperçu vient d'être envoyé avec succès à %s"
204
 
205
+ #: ../wpbe.php:336
206
+ msgid ""
207
+ "An error occured while sending email. Please check your server configuration."
208
+ msgstr ""
209
+ "Une erreur a eu lieu lors de l'envoi. Vérifiez la configuration de votre "
210
+ "serveur."
211
 
212
+ #: ../wpbe.php:503
213
  msgid "Some dynamic tags can be included in your email template :"
214
  msgstr "Des tags dynamiques peuvent être inclus dans votre template :"
215
 
216
+ #: ../wpbe.php:505
217
  msgid "<strong>%content%</strong> : will be replaced with the message content."
218
  msgstr "<strong>%content%</strong> : sera remplacé par le contenu du message."
219
 
220
+ #: ../wpbe.php:506
221
+ msgid ""
222
+ "NOTE: The content tag is <strong>required</strong>, WP Better Emails will be "
223
+ "automatically desactivated if no content tag is found."
224
+ msgstr ""
225
+ "NOTE: Le tag \"content\" est <strong>requis</strong>, WP Better Emails sera "
226
+ "automatiquement désactivé si ce tag n'est pas trouvé dans le modèle."
227
 
228
+ #: ../wpbe.php:507
229
  msgid "<strong>%blog_url%</strong> : will be replaced with your blog URL."
230
  msgstr "<strong>%blog_url%</strong> : sera remplacé par l'URL de votre blog."
231
 
232
+ #: ../wpbe.php:508
233
  msgid "<strong>%home_url%</strong> : will be replaced with your home URL."
234
+ msgstr ""
235
+ "<strong>%home_url%</strong> : sera remplacé par l'URL d'accueil de votre "
236
+ "blog."
237
 
238
+ #: ../wpbe.php:509
239
  msgid "<strong>%blog_name%</strong> : will be replaced with your blog name."
240
  msgstr "<strong>%blog_name%</strong> : sera remplacé par le nom de votre blog."
241
 
242
+ #: ../wpbe.php:510
243
+ msgid ""
244
+ "<strong>%blog_description%</strong> : will be replaced with your blog "
245
+ "description."
246
+ msgstr ""
247
+ "<strong>%blog_description%</strong> : sera remplacé par la description de "
248
+ "votre blog."
249
 
250
+ #: ../wpbe.php:511
251
  msgid "<strong>%admin_email%</strong> : will be replaced with admin email."
252
+ msgstr ""
253
+ "<strong>%admin_email%</strong> : sera remplacé par l'email de "
254
+ "l'administrateur."
255
+
256
+ #: ../wpbe.php:512
257
+ msgid ""
258
+ "<strong>%date%</strong> : will be replaced with current date, as formatted "
259
+ "in <a href=\"options-general.php\">general options</a>."
260
+ msgstr ""
261
+ "<strong>%date%</strong> : sera remplacé par la date courante, telle que "
262
+ "formatée dans les <a href=\"options-general.php\">options générales</a>."
263
+
264
+ #: ../wpbe.php:513
265
+ msgid ""
266
+ "<strong>%time%</strong> : will be replaced with current time, as formatted "
267
+ "in <a href=\"options-general.php\">general options</a>."
268
+ msgstr ""
269
+ "<strong>%time%</strong> : sera remplacé par l'heure courante, telle que "
270
+ "formatée dans les <a href=\"options-general.php\">options générales</a>."
271
+
272
+ #: ../templates/template-1.php:38
273
+ msgid "Date"
274
+ msgstr "Date"
275
 
276
+ #: ../templates/template-1.php:38
277
+ msgid "Email sent"
278
+ msgstr "Email envoyé le"
279
 
280
+ #: ../templates/template-1.php:39
281
+ msgid "Contact"
282
+ msgstr "Contact"
283
 
284
+ #: ../templates/template-1.php:39
285
+ msgid "For any requests, please contact"
286
+ msgstr "Pour toute demande, contactez"
langs/wp-better-emails-pt_BR.mo ADDED
Binary file
langs/wp-better-emails-pt_BR.po ADDED
@@ -0,0 +1,255 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright (C) 2010
2
+ # This file is distributed under the same license as the package.
3
+ msgid ""
4
+ msgstr ""
5
+ "Project-Id-Version: WP Better Emails\n"
6
+ "Report-Msgid-Bugs-To: http://wordpress.org/tag/wp-better-emails\n"
7
+ "POT-Creation-Date: 2011-09-06 23:22:41+00:00\n"
8
+ "MIME-Version: 1.0\n"
9
+ "Content-Type: text/plain; charset=UTF-8\n"
10
+ "Content-Transfer-Encoding: 8bit\n"
11
+ "PO-Revision-Date: 2013-04-04 17:09-0300\n"
12
+ "Last-Translator: Johnny Bauer <thankamikase@yahoo.com.br>\n"
13
+ "Language-Team: Johnny Bauer <thankamikase@yahoo.com.br>\n"
14
+ "Language: Português\n"
15
+ "X-Generator: Poedit 1.5.5\n"
16
+ "X-Poedit-SourceCharset: UTF-8\n"
17
+
18
+ #: wpbe-options.php:2 wpbe.php:158
19
+ msgid "Email settings"
20
+ msgstr "Configurações de Emails"
21
+
22
+ #: wpbe-options.php:9
23
+ msgid ""
24
+ "Set your own sender name and email address. Default Wordpress values will be "
25
+ "used if empty."
26
+ msgstr ""
27
+ "Adicione o nome e endereço de email que você deseja que apareça como "
28
+ "remetente. Se deixar estes campos em branco será utilizado o que está "
29
+ "configurado como padrão no Wordpress."
30
+
31
+ #: wpbe-options.php:12
32
+ msgid "Name"
33
+ msgstr "Nome"
34
+
35
+ #: wpbe-options.php:16
36
+ msgid "Email address"
37
+ msgstr "Endereço de email"
38
+
39
+ #: wpbe-options.php:22
40
+ msgid "HTML Template"
41
+ msgstr "Modelo HTML"
42
+
43
+ #: wpbe-options.php:24
44
+ msgid "Live template preview"
45
+ msgstr "Veja a prévia"
46
+
47
+ #: wpbe-options.php:24
48
+ msgid "Live preview"
49
+ msgstr "Exemplo"
50
+
51
+ #: wpbe-options.php:26
52
+ msgid ""
53
+ "Edit the HTML email template if you want to customize it. You might have a "
54
+ "look at <a href=\"#\" id=\"wpbe_help\">help tab</a> for further information."
55
+ msgstr ""
56
+ "Edite o modelo HTML da mensagem se você deseja personalizá-la. Caso precise, "
57
+ "dê uma olhada na <a href=\"#\" id=\"wpbe_help\">aba de ajuda</a> para obter "
58
+ "informações."
59
+
60
+ #: wpbe-options.php:35
61
+ msgid "Send an email preview to"
62
+ msgstr "Envie um email de exemplo para"
63
+
64
+ #: wpbe-options.php:39
65
+ msgid "Send"
66
+ msgstr "Enviar"
67
+
68
+ #: wpbe-options.php:41
69
+ msgid "You must save your template before sending an email preview."
70
+ msgstr "Você deve salvar o modelo antes de enviar um exemplo de email."
71
+
72
+ #: wpbe-options.php:46
73
+ msgid "Save Changes"
74
+ msgstr "Salvar alterações"
75
+
76
+ #: wpbe-options.php:52
77
+ msgid "Support & bug report"
78
+ msgstr "Suporte e Reportar erros"
79
+
80
+ #: wpbe-options.php:53
81
+ msgid ""
82
+ "If you have any idea to improve this plugin or any bug to report, please "
83
+ "email me at : <a href=\"mailto:plugins@artyshow-studio.fr?subject=[wp-better-"
84
+ "emails]\">plugins@artyshow-studio.fr</a>"
85
+ msgstr ""
86
+ "Se você tem alguma ideia para melhorar este plugin ou quiser reportar algum "
87
+ "erro, por favor envie um email para: <a href=\"mailto:plugins@artyshow-"
88
+ "studio.fr?subject=[wp-better-emails]\">plugins@artyshow-studio.fr</a>"
89
+
90
+ #: wpbe-options.php:55
91
+ msgid ""
92
+ "You like this plugin ? You use it in a business context ? Please, consider a "
93
+ "<a href=\"%s\" target=\"_blank\" rel=\"external\">donation</a>."
94
+ msgstr ""
95
+ "Gostou deste plugin? Está utilizando ele em sua empresa? Por favor, "
96
+ "considere fazer uma <a href=\"%s\" target=\"_blank\" rel=\"external"
97
+ "\">doação</a>."
98
+
99
+ #: templates/template-1.php:33
100
+ msgid "Date"
101
+ msgstr "Data"
102
+
103
+ #: templates/template-1.php:33
104
+ msgid "Email sent"
105
+ msgstr "Email enviado em"
106
+
107
+ #: templates/template-1.php:34
108
+ msgid "Contact"
109
+ msgstr "Contato"
110
+
111
+ #: templates/template-1.php:34
112
+ msgid "For any requests, please contact"
113
+ msgstr "Se tiver dúvidas, entre em contato"
114
+
115
+ #: wpbe.php:131
116
+ msgid "Settings"
117
+ msgstr "Opções"
118
+
119
+ #: wpbe.php:147
120
+ msgid "WP Better Emails requires WordPress 2.8 or newer."
121
+ msgstr "WP Better Emails requer WordPress 2.8 ou mais recente."
122
+
123
+ #: wpbe.php:147
124
+ msgid "Upgrade your Wordpress installation."
125
+ msgstr "Atualize seu Wordpress"
126
+
127
+ #: wpbe.php:158
128
+ msgid "WP Better Emails"
129
+ msgstr "WP Better Emails"
130
+
131
+ #: wpbe.php:228
132
+ msgid "Please enter a valid sender email address."
133
+ msgstr "Por favor, insira um endereço de email válido para o remetente."
134
+
135
+ #: wpbe.php:238
136
+ msgid "Template is empty"
137
+ msgstr "Modelo está vazio"
138
+
139
+ #: wpbe.php:241
140
+ msgid "No content tag found. The %content% tag is required in your template"
141
+ msgstr ""
142
+ "Nenhuma tag de conteúdo encontrada. A tag %content% é necessária em seu "
143
+ "modelo"
144
+
145
+ #: wpbe.php:259
146
+ msgid "Please enter an email"
147
+ msgstr "Por favor, insira um email"
148
+
149
+ #: wpbe.php:261
150
+ msgid "Please enter a valid email"
151
+ msgstr "Por favor, insira um email válido"
152
+
153
+ #: wpbe.php:262
154
+ msgid "Hey !"
155
+ msgstr "Olá!"
156
+
157
+ #: wpbe.php:264
158
+ msgid "This is a sample email to test your HTML template."
159
+ msgstr "Este é um email de exemplo para testar seu modelo HTML."
160
+
161
+ #: wpbe.php:266
162
+ msgid ""
163
+ "If you're not skilled in HTML/CSS email coding, I strongly recommend to "
164
+ "leave the default template as it is. It has been tested on various and "
165
+ "popular email clients like Gmail, Yahoo Mail, Hotmail/Live, Thunderbird, "
166
+ "Apple Mail, Outlook, and many more."
167
+ msgstr ""
168
+ "Se você não tem habilidades em HTML ou CSS, recomendamos que deixe o modelo "
169
+ "padrão como está. Ele foi testado em vários e populares clientes de email, "
170
+ "como Gmail, Yahoo, Hotmail/Live, Thunderbird, Apple Mail, Outlook, e muitos "
171
+ "outros."
172
+
173
+ #: wpbe.php:268
174
+ msgid ""
175
+ "If you have any problems or any suggestions to improve this plugin, please "
176
+ "let me know."
177
+ msgstr ""
178
+ "Se você está tendo algum problema ou sugestões para melhorar este plugin, "
179
+ "por favor entre em contato."
180
+
181
+ #: wpbe.php:269
182
+ msgid "Email template preview"
183
+ msgstr "Exemplo de modelo de email"
184
+
185
+ #: wpbe.php:270
186
+ msgid "An email preview has been successfully sent to %s"
187
+ msgstr "Um exemplo de email foi enviado com sucesso para %s"
188
+
189
+ #: wpbe.php:273
190
+ msgid ""
191
+ "An error occured while sending email. Please check your server configuration."
192
+ msgstr ""
193
+ "Um erro ocorreu enquanto o email era enviado. Por favor, verifique as "
194
+ "configurações do seu servidor."
195
+
196
+ #: wpbe.php:410
197
+ msgid "Some dynamic tags can be included in your email template :"
198
+ msgstr "Algumas tags dinâmicas podem ser inseridas no modelo do seu email:"
199
+
200
+ #: wpbe.php:412
201
+ msgid "<strong>%content%</strong> : will be replaced with the message content."
202
+ msgstr ""
203
+ "<strong>%content%</strong> : será substituído pelo conteúdo da mensagem."
204
+
205
+ #: wpbe.php:413
206
+ msgid ""
207
+ "NOTE: The content tag is <strong>required</strong>, WP Better Emails will be "
208
+ "automatically desactivated if no content tag is found."
209
+ msgstr ""
210
+ "OBS: O Conteúdo da tag é <strong>necessário</strong>, WP Better Emails irá "
211
+ "desativar automaticamente se não for localizado conteúdo para esta tag."
212
+
213
+ #: wpbe.php:414
214
+ msgid "<strong>%blog_url%</strong> : will be replaced with your blog URL."
215
+ msgstr "<strong>%blog_url%</strong> : será substituído pela URL do seu blog."
216
+
217
+ #: wpbe.php:415
218
+ msgid "<strong>%home_url%</strong> : will be replaced with your home URL."
219
+ msgstr ""
220
+ "<strong>%home_url%</strong> : será substituído pela URL da sua página "
221
+ "inicial."
222
+
223
+ #: wpbe.php:416
224
+ msgid "<strong>%blog_name%</strong> : will be replaced with your blog name."
225
+ msgstr "<strong>%blog_name%</strong> : será substituído pelo nome do seu blog."
226
+
227
+ #: wpbe.php:417
228
+ msgid ""
229
+ "<strong>%blog_description%</strong> : will be replaced with your blog "
230
+ "description."
231
+ msgstr ""
232
+ "<strong>%blog_description%</strong> : será substituído pela descrição do seu "
233
+ "blog."
234
+
235
+ #: wpbe.php:418
236
+ msgid "<strong>%admin_email%</strong> : will be replaced with admin email."
237
+ msgstr ""
238
+ "<strong>%admin_email%</strong> : será substituído pelo email configurado "
239
+ "como administrador no Wordpress."
240
+
241
+ #: wpbe.php:419
242
+ msgid ""
243
+ "<strong>%date%</strong> : will be replaced with current date, as formatted "
244
+ "in <a href=\"options-general.php\">general options</a>."
245
+ msgstr ""
246
+ "<strong>%date%</strong> : será substituído pela data atual, de acordo com o "
247
+ "definido nas <a href=\"options-general.php\">opções gerais do Wordpress</a>."
248
+
249
+ #: wpbe.php:420
250
+ msgid ""
251
+ "<strong>%time%</strong> : will be replaced with current time, as formatted "
252
+ "in <a href=\"options-general.php\">general options</a>."
253
+ msgstr ""
254
+ "<strong>%time%</strong> : será substituído pela hora atual, de acordo com o "
255
+ "definido nas <a href=\"options-general.php\">opções gerais do Wordpress</a>."
langs/wp-better-emails.mo DELETED
Binary file
langs/wp-better-emails.pot CHANGED
@@ -1,195 +1,254 @@
1
- # Copyright (C) 2010
2
- # This file is distributed under the same license as the package.
3
  msgid ""
4
  msgstr ""
5
  "Project-Id-Version: WP Better Emails\n"
6
- "Report-Msgid-Bugs-To: http://wordpress.org/tag/wp-better-emails\n"
7
- "POT-Creation-Date: 2011-09-06 23:22:41+00:00\n"
 
 
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
- "PO-Revision-Date: 2011-09-12 17:37+0100\n"
12
- "Last-Translator: \n"
13
- "Language-Team: Team <plugins@artyshow-studio.fr>\n"
14
-
15
- #: wpbe-options.php:2
16
- #: wpbe.php:158
 
 
 
 
 
17
  msgid "Email settings"
18
  msgstr ""
19
 
20
- #: wpbe-options.php:9
21
- msgid "Set your own sender name and email address. Default Wordpress values will be used if empty."
22
  msgstr ""
23
 
24
- #: wpbe-options.php:12
 
 
 
 
 
 
25
  msgid "Name"
26
  msgstr ""
27
 
28
- #: wpbe-options.php:16
29
  msgid "Email address"
30
  msgstr ""
31
 
32
- #: wpbe-options.php:22
33
  msgid "HTML Template"
34
  msgstr ""
35
 
36
- #: wpbe-options.php:24
37
  msgid "Live template preview"
38
  msgstr ""
39
 
40
- #: wpbe-options.php:24
41
  msgid "Live preview"
42
  msgstr ""
43
 
44
- #: wpbe-options.php:26
45
- msgid "Edit the HTML email template if you want to customize it. You might have a look at <a href="#" id="wpbe_help">help tab</a> for further information."
 
 
46
  msgstr ""
47
 
48
- #: wpbe-options.php:35
49
- msgid "Send an email preview to"
50
  msgstr ""
51
 
52
- #: wpbe-options.php:39
53
- msgid "Send"
 
 
 
54
  msgstr ""
55
 
56
- #: wpbe-options.php:41
57
- msgid "You must save your template before sending an email preview."
58
  msgstr ""
59
 
60
- #: wpbe-options.php:46
61
- msgid "Save Changes"
62
- msgstr ""
63
-
64
- #: wpbe-options.php:52
65
- msgid "Support & bug report"
66
  msgstr ""
67
 
68
- #: wpbe-options.php:53
69
- msgid "If you have any idea to improve this plugin or any bug to report, please email me at : <a href=\"mailto:plugins@artyshow-studio.fr?subject=[wp-better-emails]\">plugins@artyshow-studio.fr</a>"
70
  msgstr ""
71
 
72
- #: wpbe-options.php:55
73
- msgid "You like this plugin ? You use it in a business context ? Please, consider a <a href=\"%s\" target=\"_blank\" rel=\"external\">donation</a>."
74
  msgstr ""
75
 
76
- #: templates/template-1.php:33
77
- msgid "Date"
78
  msgstr ""
79
 
80
- #: templates/template-1.php:33
81
- msgid "Email sent"
82
  msgstr ""
83
 
84
- #: templates/template-1.php:34
85
- msgid "Contact"
 
 
 
86
  msgstr ""
87
 
88
- #: templates/template-1.php:34
89
- msgid "For any requests, please contact"
 
 
 
90
  msgstr ""
91
 
92
- #: wpbe.php:131
93
  msgid "Settings"
94
  msgstr ""
95
 
96
- #: wpbe.php:147
97
  msgid "WP Better Emails requires WordPress 2.8 or newer."
98
  msgstr ""
99
 
100
- #: wpbe.php:147
101
  msgid "Upgrade your Wordpress installation."
102
  msgstr ""
103
 
104
- #: wpbe.php:158
105
  msgid "WP Better Emails"
106
  msgstr ""
107
 
108
- #: wpbe.php:228
109
  msgid "Please enter a valid sender email address."
110
  msgstr ""
111
 
112
- #: wpbe.php:238
113
  msgid "Template is empty"
114
  msgstr ""
115
 
116
- #: wpbe.php:241
117
  msgid "No content tag found. The %content% tag is required in your template"
118
  msgstr ""
119
 
120
- #: wpbe.php:259
 
 
 
 
 
 
 
 
 
 
121
  msgid "Please enter an email"
122
  msgstr ""
123
 
124
- #: wpbe.php:261
125
  msgid "Please enter a valid email"
126
  msgstr ""
127
 
128
- #: wpbe.php:262
129
  msgid "Hey !"
130
  msgstr ""
131
 
132
- #: wpbe.php:264
133
  msgid "This is a sample email to test your HTML template."
134
  msgstr ""
135
 
136
- #: wpbe.php:266
137
- msgid "If you're not skilled in HTML/CSS email coding, I strongly recommend to leave the default template as it is. It has been tested on various and popular email clients like Gmail, Yahoo Mail, Hotmail/Live, Thunderbird, Apple Mail, Outlook, and many more."
 
 
 
 
138
  msgstr ""
139
 
140
- #: wpbe.php:268
141
- msgid "If you have any problems or any suggestions to improve this plugin, please let me know."
 
 
142
  msgstr ""
143
 
144
- #: wpbe.php:269
145
  msgid "Email template preview"
146
  msgstr ""
147
 
148
- #: wpbe.php:270
 
149
  msgid "An email preview has been successfully sent to %s"
150
  msgstr ""
151
 
152
- #: wpbe.php:273
153
- msgid "An error occured while sending email. Please check your server configuration."
 
154
  msgstr ""
155
 
156
- #: wpbe.php:410
157
  msgid "Some dynamic tags can be included in your email template :"
158
  msgstr ""
159
 
160
- #: wpbe.php:412
161
  msgid "<strong>%content%</strong> : will be replaced with the message content."
162
  msgstr ""
163
 
164
- #: wpbe.php:413
165
- msgid "NOTE: The content tag is <strong>required</strong>, WP Better Emails will be automatically desactivated if no content tag is found."
 
 
166
  msgstr ""
167
 
168
- #: wpbe.php:414
169
  msgid "<strong>%blog_url%</strong> : will be replaced with your blog URL."
170
  msgstr ""
171
 
172
- #: wpbe.php:415
173
  msgid "<strong>%home_url%</strong> : will be replaced with your home URL."
174
  msgstr ""
175
 
176
- #: wpbe.php:416
177
  msgid "<strong>%blog_name%</strong> : will be replaced with your blog name."
178
  msgstr ""
179
 
180
- #: wpbe.php:417
181
- msgid "<strong>%blog_description%</strong> : will be replaced with your blog description."
 
 
182
  msgstr ""
183
 
184
- #: wpbe.php:418
185
  msgid "<strong>%admin_email%</strong> : will be replaced with admin email."
186
  msgstr ""
187
 
188
- #: wpbe.php:419
189
- msgid "<strong>%date%</strong> : will be replaced with current date, as formatted in <a href=\"options-general.php\">general options</a>."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
190
  msgstr ""
191
 
192
- #: wpbe.php:420
193
- msgid "<strong>%time%</strong> : will be replaced with current time, as formatted in <a href=\"options-general.php\">general options</a>."
194
  msgstr ""
195
 
 
 
 
 
 
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: WP Better Emails\n"
4
+ "POT-Creation-Date: 2013-04-08 14:50+0100\n"
5
+ "PO-Revision-Date: 2013-04-09 16:29+0100\n"
6
+ "Last-Translator: \n"
7
+ "Language-Team: <plugins@artyshow-studio.fr>\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
+ "X-Generator: Poedit 1.5.5\n"
12
+ "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;"
13
+ "_n_noop:1,2;_c;_nc:4c,1,2;_x:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;_ex:1,2c;"
14
+ "esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c\n"
15
+ "X-Poedit-Basepath: .\n"
16
+ "X-Poedit-SourceCharset: UTF-8\n"
17
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
18
+ "X-Poedit-SearchPath-0: .\n"
19
+ "X-Poedit-SearchPath-1: ..\n"
20
+
21
+ #: ../wpbe-options.php:2 ../wpbe.php:186
22
  msgid "Email settings"
23
  msgstr ""
24
 
25
+ #: ../wpbe-options.php:8
26
+ msgid "Sender Options"
27
  msgstr ""
28
 
29
+ #: ../wpbe-options.php:9
30
+ msgid ""
31
+ "Set your own sender name and email address. Default WordPress values will be "
32
+ "used if empty."
33
+ msgstr ""
34
+
35
+ #: ../wpbe-options.php:12
36
  msgid "Name"
37
  msgstr ""
38
 
39
+ #: ../wpbe-options.php:16
40
  msgid "Email address"
41
  msgstr ""
42
 
43
+ #: ../wpbe-options.php:22
44
  msgid "HTML Template"
45
  msgstr ""
46
 
47
+ #: ../wpbe-options.php:24
48
  msgid "Live template preview"
49
  msgstr ""
50
 
51
+ #: ../wpbe-options.php:24
52
  msgid "Live preview"
53
  msgstr ""
54
 
55
+ #: ../wpbe-options.php:27
56
+ msgid ""
57
+ "Edit the HTML template if you want to customize it. You might have a look at "
58
+ "the <a href=\"#\" class=\"wpbe_help\">help tab</a> for further information."
59
  msgstr ""
60
 
61
+ #: ../wpbe-options.php:33
62
+ msgid "Plain-text Template"
63
  msgstr ""
64
 
65
+ #: ../wpbe-options.php:34
66
+ msgid ""
67
+ "Edit the plain-text template if you want to customize it. You might have a "
68
+ "look at the <a href=\"#\" class=\"wpbe_help\">help tab</a> for further "
69
+ "information."
70
  msgstr ""
71
 
72
+ #: ../wpbe-options.php:40
73
+ msgid "Preview"
74
  msgstr ""
75
 
76
+ #: ../wpbe-options.php:45
77
+ msgid "Send an email preview to"
 
 
 
 
78
  msgstr ""
79
 
80
+ #: ../wpbe-options.php:49
81
+ msgid "Send"
82
  msgstr ""
83
 
84
+ #: ../wpbe-options.php:51
85
+ msgid "You must save your template before sending an email preview."
86
  msgstr ""
87
 
88
+ #: ../wpbe-options.php:56
89
+ msgid "Save Changes"
90
  msgstr ""
91
 
92
+ #: ../wpbe-options.php:61
93
+ msgid "Support & bug report"
94
  msgstr ""
95
 
96
+ #: ../wpbe-options.php:62
97
+ msgid ""
98
+ "If you have any idea to improve this plugin or any bug to report, please "
99
+ "email me at : <a href=\"mailto:plugins@artyshow-studio.fr?subject=[wp-better-"
100
+ "emails]\">plugins@artyshow-studio.fr</a>"
101
  msgstr ""
102
 
103
+ #: ../wpbe-options.php:64
104
+ #, php-format
105
+ msgid ""
106
+ "You like this plugin ? You use it in a business context ? Please, consider a "
107
+ "<a href=\"%s\" target=\"_blank\" rel=\"external\">donation</a>."
108
  msgstr ""
109
 
110
+ #: ../wpbe.php:156
111
  msgid "Settings"
112
  msgstr ""
113
 
114
+ #: ../wpbe.php:174
115
  msgid "WP Better Emails requires WordPress 2.8 or newer."
116
  msgstr ""
117
 
118
+ #: ../wpbe.php:174
119
  msgid "Upgrade your Wordpress installation."
120
  msgstr ""
121
 
122
+ #: ../wpbe.php:186
123
  msgid "WP Better Emails"
124
  msgstr ""
125
 
126
+ #: ../wpbe.php:263
127
  msgid "Please enter a valid sender email address."
128
  msgstr ""
129
 
130
+ #: ../wpbe.php:276
131
  msgid "Template is empty"
132
  msgstr ""
133
 
134
+ #: ../wpbe.php:280
135
  msgid "No content tag found. The %content% tag is required in your template"
136
  msgstr ""
137
 
138
+ #: ../wpbe.php:289
139
+ msgid "Plain-text template is empty"
140
+ msgstr ""
141
+
142
+ #: ../wpbe.php:293
143
+ msgid ""
144
+ "No content tag found. The %content% tag is required in your plain-text "
145
+ "template"
146
+ msgstr ""
147
+
148
+ #: ../wpbe.php:317
149
  msgid "Please enter an email"
150
  msgstr ""
151
 
152
+ #: ../wpbe.php:320
153
  msgid "Please enter a valid email"
154
  msgstr ""
155
 
156
+ #: ../wpbe.php:323
157
  msgid "Hey !"
158
  msgstr ""
159
 
160
+ #: ../wpbe.php:325
161
  msgid "This is a sample email to test your HTML template."
162
  msgstr ""
163
 
164
+ #: ../wpbe.php:327
165
+ msgid ""
166
+ "If you're not skilled in HTML/CSS email coding, I strongly recommend to "
167
+ "leave the default template as it is. It has been tested on various and "
168
+ "popular email clients like Gmail, Yahoo Mail, Hotmail/Live, Thunderbird, "
169
+ "Apple Mail, Outlook, and many more."
170
  msgstr ""
171
 
172
+ #: ../wpbe.php:329
173
+ msgid ""
174
+ "If you have any problems or any suggestions to improve this plugin, please "
175
+ "let me know."
176
  msgstr ""
177
 
178
+ #: ../wpbe.php:333
179
  msgid "Email template preview"
180
  msgstr ""
181
 
182
+ #: ../wpbe.php:334
183
+ #, php-format
184
  msgid "An email preview has been successfully sent to %s"
185
  msgstr ""
186
 
187
+ #: ../wpbe.php:336
188
+ msgid ""
189
+ "An error occured while sending email. Please check your server configuration."
190
  msgstr ""
191
 
192
+ #: ../wpbe.php:503
193
  msgid "Some dynamic tags can be included in your email template :"
194
  msgstr ""
195
 
196
+ #: ../wpbe.php:505
197
  msgid "<strong>%content%</strong> : will be replaced with the message content."
198
  msgstr ""
199
 
200
+ #: ../wpbe.php:506
201
+ msgid ""
202
+ "NOTE: The content tag is <strong>required</strong>, WP Better Emails will be "
203
+ "automatically desactivated if no content tag is found."
204
  msgstr ""
205
 
206
+ #: ../wpbe.php:507
207
  msgid "<strong>%blog_url%</strong> : will be replaced with your blog URL."
208
  msgstr ""
209
 
210
+ #: ../wpbe.php:508
211
  msgid "<strong>%home_url%</strong> : will be replaced with your home URL."
212
  msgstr ""
213
 
214
+ #: ../wpbe.php:509
215
  msgid "<strong>%blog_name%</strong> : will be replaced with your blog name."
216
  msgstr ""
217
 
218
+ #: ../wpbe.php:510
219
+ msgid ""
220
+ "<strong>%blog_description%</strong> : will be replaced with your blog "
221
+ "description."
222
  msgstr ""
223
 
224
+ #: ../wpbe.php:511
225
  msgid "<strong>%admin_email%</strong> : will be replaced with admin email."
226
  msgstr ""
227
 
228
+ #: ../wpbe.php:512
229
+ msgid ""
230
+ "<strong>%date%</strong> : will be replaced with current date, as formatted "
231
+ "in <a href=\"options-general.php\">general options</a>."
232
+ msgstr ""
233
+
234
+ #: ../wpbe.php:513
235
+ msgid ""
236
+ "<strong>%time%</strong> : will be replaced with current time, as formatted "
237
+ "in <a href=\"options-general.php\">general options</a>."
238
+ msgstr ""
239
+
240
+ #: ../templates/template-1.php:38
241
+ msgid "Date"
242
+ msgstr ""
243
+
244
+ #: ../templates/template-1.php:38
245
+ msgid "Email sent"
246
  msgstr ""
247
 
248
+ #: ../templates/template-1.php:39
249
+ msgid "Contact"
250
  msgstr ""
251
 
252
+ #: ../templates/template-1.php:39
253
+ msgid "For any requests, please contact"
254
+ msgstr ""
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=7Q49VJQNRCQ8E&lc=FR&item_name=ArtyShow&item_number=wp%2dbetter%2demails&currency_code=EUR&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted
3
  Tags: email, emails, html emails, templates, notification, wp_mail, wpmu, multisite
4
  Requires at least: 2.8
5
- Tested up to: 3.4.2
6
- Stable tag: 0.2.4.1
7
 
8
  Adds a customizable good looking HTML template to all WP default plain/text emails and lets you set
9
  a custom sender name and email address.
@@ -44,6 +44,7 @@ WP Better Emails is currently available in :
44
  * Italian - [Fabio Lelli](http://www.synaestesia.com/ "Fabio Lelli")
45
  * Arabic - [Yaser Maadan](http://www.englize.com/ "Yaser Maadan")
46
  * Simplified Chinese - [Will Yuan](http://yslove.net/ "Will Yuan")
 
47
 
48
  I'm looking for translators to extend to other languages. If you have translated the plugin in your language or want to,
49
  please let me know : plugins [ at ] artyshow-studio.fr
@@ -120,6 +121,12 @@ You can place this function in your functions.php theme file or in a plugin.
120
 
121
  == Changelog ==
122
 
 
 
 
 
 
 
123
  = 0.2.4.1 =
124
 
125
  * Lower HTML filter priority to make the plugin more compatible with other plugins (Woocommerce, etc.)
2
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=7Q49VJQNRCQ8E&lc=FR&item_name=ArtyShow&item_number=wp%2dbetter%2demails&currency_code=EUR&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted
3
  Tags: email, emails, html emails, templates, notification, wp_mail, wpmu, multisite
4
  Requires at least: 2.8
5
+ Tested up to: 3.5.1
6
+ Stable tag: 0.2.5
7
 
8
  Adds a customizable good looking HTML template to all WP default plain/text emails and lets you set
9
  a custom sender name and email address.
44
  * Italian - [Fabio Lelli](http://www.synaestesia.com/ "Fabio Lelli")
45
  * Arabic - [Yaser Maadan](http://www.englize.com/ "Yaser Maadan")
46
  * Simplified Chinese - [Will Yuan](http://yslove.net/ "Will Yuan")
47
+ * Brazilian portuguese - [Johnny Bauer](mailto:thankamikase@yahoo.com.br "Johnny Bauer")
48
 
49
  I'm looking for translators to extend to other languages. If you have translated the plugin in your language or want to,
50
  please let me know : plugins [ at ] artyshow-studio.fr
121
 
122
  == Changelog ==
123
 
124
+ = 0.2.5 =
125
+
126
+ * Added plain text template support
127
+ * Fixed phpmailer_init action
128
+ * Brazilian portuguese translation added
129
+
130
  = 0.2.4.1 =
131
 
132
  * Lower HTML filter priority to make the plugin more compatible with other plugins (Woocommerce, etc.)
wpbe-options.php CHANGED
@@ -3,9 +3,10 @@
3
 
4
  <form method="post" action="options.php" id="wpbe_options_form">
5
  <?php settings_fields('wpbe_full_options'); ?>
6
-
7
  <!-- Sender options -->
8
- <p style="margin-bottom: 0;"><?php _e('Set your own sender name and email address. Default Wordpress values will be used if empty.', 'wp-better-emails'); ?></p>
 
9
  <table class="form-table">
10
  <tr valign="top">
11
  <th scope="row"><label for="wpbe_from_name"><?php _e('Name', 'wp-better-emails'); ?></label></th>
@@ -16,17 +17,27 @@
16
  <td><input type="text" id="wpbe_from_email" class="regular-text" name="wpbe_options[from_email]" value="<?php echo esc_attr_e($this->options['from_email']); ?>" /></td>
17
  </tr>
18
  </table>
19
-
20
  <!-- Template -->
21
  <h3 class="wpbe_title"><?php _e('HTML Template', 'wp-better-emails'); ?>
22
  <?php if( version_compare($wp_version, '3.1', '>') ): ?>
23
  <a class="thickbox button" title="<?php esc_attr_e('Live template preview', 'wp-better-emails'); ?>" id="wpbe_preview_template" href="<?php echo plugins_url('preview.html?keepThis=true&TB_iframe=true&height=400&width=700', __FILE__); ?>"><?php _e('Live preview', 'wp-better-emails'); ?></a>
24
  <?php endif; ?>
25
  </h3>
26
- <p><?php _e('Edit the HTML email template if you want to customize it. You might have a look at the <a href="#" id="wpbe_help">help tab</a> for further information.', 'wp-better-emails'); ?></p>
27
  <div id="wpbe_template_container">
28
  <?php $this->template_editor() ?>
29
  </div>
 
 
 
 
 
 
 
 
 
 
30
  <div id="wpbe_preview_message"></div>
31
  <table class="form-table">
32
  <tr valign="top">
3
 
4
  <form method="post" action="options.php" id="wpbe_options_form">
5
  <?php settings_fields('wpbe_full_options'); ?>
6
+
7
  <!-- Sender options -->
8
+ <h3 class="wpbe_title"><?php _e('Sender Options', 'wp-better-emails'); ?></h3>
9
+ <p style="margin-bottom: 0;"><?php _e('Set your own sender name and email address. Default WordPress values will be used if empty.', 'wp-better-emails'); ?></p>
10
  <table class="form-table">
11
  <tr valign="top">
12
  <th scope="row"><label for="wpbe_from_name"><?php _e('Name', 'wp-better-emails'); ?></label></th>
17
  <td><input type="text" id="wpbe_from_email" class="regular-text" name="wpbe_options[from_email]" value="<?php echo esc_attr_e($this->options['from_email']); ?>" /></td>
18
  </tr>
19
  </table>
20
+
21
  <!-- Template -->
22
  <h3 class="wpbe_title"><?php _e('HTML Template', 'wp-better-emails'); ?>
23
  <?php if( version_compare($wp_version, '3.1', '>') ): ?>
24
  <a class="thickbox button" title="<?php esc_attr_e('Live template preview', 'wp-better-emails'); ?>" id="wpbe_preview_template" href="<?php echo plugins_url('preview.html?keepThis=true&TB_iframe=true&height=400&width=700', __FILE__); ?>"><?php _e('Live preview', 'wp-better-emails'); ?></a>
25
  <?php endif; ?>
26
  </h3>
27
+ <p><?php _e('Edit the HTML template if you want to customize it. You might have a look at the <a href="#" class="wpbe_help">help tab</a> for further information.', 'wp-better-emails'); ?></p>
28
  <div id="wpbe_template_container">
29
  <?php $this->template_editor() ?>
30
  </div>
31
+
32
+ <!-- Plain-text template -->
33
+ <h3 class="wpbe_title"><?php _e('Plain-text Template', 'wp-better-emails'); ?></h3>
34
+ <p><?php _e('Edit the plain-text template if you want to customize it. You might have a look at the <a href="#" class="wpbe_help">help tab</a> for further information.', 'wp-better-emails'); ?></p>
35
+ <div id="wpbe_plaintext_template_container">
36
+ <?php $this->plaintext_template_editor(); ?>
37
+ </div>
38
+
39
+ <!-- Preview -->
40
+ <h3 class="wpbe_title"><?php _e('Preview', 'wp-better-emails'); ?></h3>
41
  <div id="wpbe_preview_message"></div>
42
  <table class="form-table">
43
  <tr valign="top">
wpbe.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: WP Better Emails
4
  Plugin URI: http://wordpress.org/extend/plugins/wp-better-emails/
5
  Description: Beautify the default text/plain WP mails into fully customizable HTML emails.
6
- Version: 0.2.4.1
7
  Author: ArtyShow
8
  Author URI: http://wordpress.org/extend/plugins/wp-better-emails/
9
  License: GPLv2
@@ -27,21 +27,23 @@
27
  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
28
  */
29
 
30
- if (!class_exists('WP_Better_Emails')) {
31
 
32
- if (!defined('WPBE_JS_URL'))
33
- define('WPBE_JS_URL', plugin_dir_url(__FILE__) . 'js');
34
- if (!defined('WPBE_CSS_URL'))
35
- define('WPBE_CSS_URL', plugin_dir_url(__FILE__) . 'css');
 
36
 
37
  class WP_Better_Emails {
38
 
39
  var $options = array();
40
  var $page = '';
 
41
 
42
  /**
43
  * Construct function (old way)
44
- *
45
  * @since 0.2
46
  */
47
  function WP_Better_Emails() {
@@ -50,66 +52,85 @@ if (!class_exists('WP_Better_Emails')) {
50
 
51
  /**
52
  * Construct function
53
- *
54
  * @since 0.2
55
  */
56
  function __construct() {
57
  global $wp_version;
58
-
59
  $this->get_options();
60
-
61
  // Front end filter
62
- add_filter('wp_mail_from_name', array(&$this, 'set_from_name'));
63
- add_filter('wp_mail_from', array($this, 'set_from_email'));
64
- add_filter('wp_mail_content_type', array(&$this, 'set_content_type'), 100);
 
65
 
66
- if (!is_admin())
67
  return;
68
 
69
  // Load translations
70
- load_plugin_textdomain('wp-better-emails', null, basename(dirname(__FILE__)) . '/langs/');
71
 
72
  // Actions
73
- add_action('admin_init', array(&$this, 'init'));
74
- add_action('admin_menu', array(&$this, 'admin_menu'));
75
- add_action('wp_ajax_send_preview', array(&$this, 'ajax_send_preview'));
76
- if (version_compare($wp_version, '3.2.1', '<='))
77
- add_action('admin_head', array(&$this, 'load_wp_tiny_mce'));
78
- if( version_compare($wp_version, '3.2', '<') && version_compare($wp_version, '3.0.6', '>') )
79
- add_action( 'admin_print_footer_scripts', 'wp_tiny_mce_preload_dialogs');
80
-
 
 
81
  // Filters
82
- add_filter('plugin_action_links_' . plugin_basename(__FILE__), array(&$this, 'settings_link'));
83
- add_filter('contextual_help', array(&$this, 'contextual_help'), 10, 3);
84
- add_filter('mce_external_plugins', array(&$this, 'tinymce_plugins'));
85
- add_filter('mce_buttons', array(&$this, 'tinymce_buttons'));
86
- add_filter('tiny_mce_before_init', array(&$this, 'tinymce_config'));
87
  }
88
 
89
  /**
90
  * Get recorded options
91
- *
92
  * @since 0.2
93
  */
94
  function get_options() {
95
- $this->options = get_option('wpbe_options');
96
  }
97
 
98
  /**
99
  * Set the default options
100
- *
101
  * @since 0.2
102
  */
103
  function set_options() {
 
 
104
  $template = '';
105
- @require('templates/template-1.php');
 
 
 
 
 
 
 
 
 
 
106
  $this->options = array(
107
- 'from_email' => '',
108
- 'from_name' => '',
109
- 'template' => $template
 
110
  );
111
- if (get_option('wpbe_options') == null)
112
- add_option('wpbe_options', $this->options);
 
 
 
113
  }
114
 
115
  /**
@@ -118,9 +139,9 @@ if (!class_exists('WP_Better_Emails')) {
118
  * @since 0.1
119
  */
120
  function init() {
121
- register_setting('wpbe_full_options', 'wpbe_options', array(&$this, 'validate_options'));
122
- wp_register_script('wpbe-admin-script', WPBE_JS_URL . '/wpbe-admin-script.js', array('jquery', 'thickbox'), null, true);
123
- wp_register_style('wpbe-admin-style', WPBE_CSS_URL . '/wpbe-admin-style.css');
124
  }
125
 
126
  /**
@@ -131,8 +152,9 @@ if (!class_exists('WP_Better_Emails')) {
131
  * @param array $links Plugin links
132
  * @return array Plugins links with settings added
133
  */
134
- function settings_link($links) {
135
- $links[] = '<a href="options-general.php?page=wpbe_options">' . __('Settings', 'wp-better-emails') . '</a>';
 
136
  return $links;
137
  }
138
 
@@ -146,10 +168,12 @@ if (!class_exists('WP_Better_Emails')) {
146
  global $wp_version;
147
  // Prevent activation if requirements are not met
148
  // WP 2.8 required
149
- if (version_compare($wp_version, '2.8', '<=')) {
150
- deactivate_plugins(__FILE__);
151
- wp_die(__('WP Better Emails requires WordPress 2.8 or newer.', 'wp-better-emails'), __('Upgrade your Wordpress installation.', 'wp-better-emails'));
 
152
  }
 
153
  $this->set_options();
154
  }
155
 
@@ -159,22 +183,25 @@ if (!class_exists('WP_Better_Emails')) {
159
  * @since 0.1
160
  */
161
  function admin_menu() {
162
- $this->page = add_options_page(__('Email settings', 'wp-better-emails'), __('WP Better Emails', 'wp-better-emails'), 'administrator', 'wpbe_options', array(&$this, 'admin_page'));
163
- add_action('admin_print_scripts-' . $this->page, array(&$this, 'admin_print_script'));
164
- add_action('admin_print_styles-' . $this->page, array(&$this, 'admin_print_style'));
 
165
  }
166
 
167
  /**
168
  * Check if we're on the plugin page
169
- *
170
  * @since 0.2
171
  * @global type $page_hook
172
- * @return type
173
  */
174
  function is_wpbe_page() {
175
  global $page_hook;
176
- if ($page_hook === $this->page)
 
177
  return true;
 
178
  return false;
179
  }
180
 
@@ -185,14 +212,17 @@ if (!class_exists('WP_Better_Emails')) {
185
  * @since 0.1
186
  */
187
  function admin_print_script() {
188
- wp_enqueue_script('wpbe-admin-script');
189
- $protocol = isset($_SERVER["HTTPS"]) ? 'https://' : 'http://';
 
 
190
  $ajax_vars = array(
191
- 'url' => admin_url('admin-ajax.php', $protocol),
192
- 'nonce' => wp_create_nonce('email_preview'),
193
  'action' => 'send_preview'
194
  );
195
- wp_localize_script('wpbe-admin-script', 'wpbe_ajax_vars', $ajax_vars);
 
196
  }
197
 
198
  /**
@@ -201,8 +231,8 @@ if (!class_exists('WP_Better_Emails')) {
201
  * @since 0.1
202
  */
203
  function admin_print_style() {
204
- wp_enqueue_style('wpbe-admin-style');
205
- wp_enqueue_style('thickbox');
206
  }
207
 
208
  /**
@@ -213,7 +243,8 @@ if (!class_exists('WP_Better_Emails')) {
213
  */
214
  function admin_page() {
215
  global $wp_version;
216
- require('wpbe-options.php');
 
217
  }
218
 
219
  /**
@@ -223,28 +254,48 @@ if (!class_exists('WP_Better_Emails')) {
223
  * @param array $input The options returned by the options page
224
  * @return array $input Sanitized values
225
  */
226
- function validate_options($input) {
227
 
228
- $from_email = strtolower($input['from_email']);
229
 
230
  // Checking emails
231
- if (!empty($from_email) && !is_email($from_email)) {
232
- add_settings_error('wpbe_options', 'settings_updated', __('Please enter a valid sender email address.', 'wp-better-emails'), 'error');
233
  $input['from_email'] = '';
234
  } else {
235
- $input['from_email'] = sanitize_email($from_email);
236
  }
237
 
238
  // Check name
239
- $input['from_name'] = esc_html($input['from_name']);
 
 
 
 
 
 
240
 
241
- if (empty($input['template']))
242
- add_settings_error('wpbe_options', 'settings_updated', __('Template is empty', 'wp-better-emails'));
243
  // Check if %content% tag is the template body
244
- elseif (strpos($input['template'], '%content%') === false)
245
- add_settings_error('wpbe_options', 'settings_updated', __('No content tag found. The %content% tag is required in your template', 'wp-better-emails'));
 
 
246
  $input['template'] = $input['template'];
247
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
248
  return $input;
249
  }
250
 
@@ -254,27 +305,36 @@ if (!class_exists('WP_Better_Emails')) {
254
  * @since 0.1
255
  * @param string $email
256
  */
257
- function ajax_send_preview($email) {
258
- if (!current_user_can('manage_options'))
259
  die();
260
- check_ajax_referer('email_preview');
261
- $preview_email = sanitize_email($_POST['preview_email']);
262
- if (empty($preview_email))
263
- die('<div class="error"><p>' . __('Please enter an email', 'wp-better-emails') . '</p></div>');
264
- if (!is_email($preview_email))
265
- die('<div class="error"><p>' . __('Please enter a valid email', 'wp-better-emails') . '</p></div>');
266
- $message = __('Hey !', 'wp-better-emails');
 
 
 
 
 
 
267
  $message .= "\r\n\r\n";
268
- $message .= __('This is a sample email to test your HTML template.', 'wp-better-emails');
269
  $message .= "\r\n\r\n";
270
- $message .= __('If you\'re not skilled in HTML/CSS email coding, I strongly recommend to leave the default template as it is. It has been tested on various and popular email clients like Gmail, Yahoo Mail, Hotmail/Live, Thunderbird, Apple Mail, Outlook, and many more.', 'wp-better-emails');
271
  $message .= "\r\n\r\n";
272
- $message .= __('If you have any problems or any suggestions to improve this plugin, please let me know.', 'wp-better-emails');
273
  $message .= "\r\n\r\n";
274
- if (wp_mail($preview_email, '[' . wp_specialchars_decode(get_option('blogname'), ENT_QUOTES) . '] - ' . __('Email template preview', 'wp-better-emails'), $message))
275
- die('<div class="updated"><p>' . sprintf(__('An email preview has been successfully sent to %s' , 'wp-better-emails'), esc_attr($preview_email) ) . '</p></div>');
276
- else
277
- die('<div class="error"><p>' . __('An error occured while sending email. Please check your server configuration.', 'wp-better-emails') . '</p></div>');
 
 
 
278
  }
279
 
280
  /**
@@ -284,19 +344,22 @@ if (!class_exists('WP_Better_Emails')) {
284
  * @param string $template Template with variables
285
  * @return string Template with variables replaced
286
  */
287
- function template_vars_replacement($template) {
288
  $to_replace = array(
289
- 'blog_url' => get_option('siteurl'),
290
- 'home_url' => get_option('home'),
291
- 'blog_name' => get_option('blogname'),
292
- 'blog_description' => get_option('blogdescription'),
293
- 'admin_email' => get_option('admin_email'),
294
- 'date' => date_i18n(get_option('date_format')),
295
- 'time' => date_i18n(get_option('time_format'))
296
  );
297
  $to_replace = apply_filters('wpbe_tags', $to_replace);
298
- foreach ($to_replace as $tag => $var)
299
- $template = str_replace('%' . $tag . '%', $var, $template);
 
 
 
300
  return $template;
301
  }
302
 
@@ -307,24 +370,31 @@ if (!class_exists('WP_Better_Emails')) {
307
  * @return bool
308
  */
309
  function check_template() {
310
- if (strpos($this->options['template'], '%content%') === false || empty($this->options['template']))
311
  return false;
 
312
  return true;
313
  }
314
 
315
  /**
316
- * Add the HTML template to the message body.
317
- * Looks for %message% into the template and replace it with the message
 
318
  *
319
  * @since 0.1
320
  * @param string $body The message to templatize
 
 
321
  * @return string $email The email surrounded by template
322
  */
323
- function set_email_template($body) {
324
  $template = '';
325
- if (isset($this->options['template']) && !empty($this->options['template']))
326
- $template .= $this->options['template'];
327
- return str_replace('%content%', $body, $template);
 
 
 
328
  }
329
 
330
  /**
@@ -332,11 +402,12 @@ if (!class_exists('WP_Better_Emails')) {
332
  *
333
  * @since 0.1
334
  * @param string $from_email
335
- * @return string
336
  */
337
- function set_from_email($from_email) {
338
- if (!empty($this->options['from_email']) && is_email($this->options['from_email']))
339
  return $this->options['from_email'];
 
340
  return $from_email;
341
  }
342
 
@@ -347,9 +418,10 @@ if (!class_exists('WP_Better_Emails')) {
347
  * @param string $from_name
348
  * @return string
349
  */
350
- function set_from_name($from_name) {
351
- if (!empty($this->options['from_name']))
352
- return wp_specialchars_decode($this->options['from_name'], ENT_QUOTES);
 
353
  return $from_name;
354
  }
355
 
@@ -360,32 +432,48 @@ if (!class_exists('WP_Better_Emails')) {
360
  * @param string $content_type
361
  * @return string $content_type
362
  */
363
- function set_content_type($content_type) {
364
  // Only convert if the message is text/plain and the template is ok
365
- if ($content_type == 'text/plain' && $this->check_template() === true) {
366
- add_action('phpmailer_init', array(&$this, 'send_html'));
367
- return $content_type = 'text/html';
 
 
368
  }
369
  return $content_type;
370
  }
371
 
372
  /**
373
- * Add the email template and set it multipart
374
  *
375
  * @since 0.1
376
  * @param object $phpmailer
377
  */
378
- function send_html($phpmailer) {
379
- // Set the original plain text message
380
- $phpmailer->AltBody = wp_specialchars_decode($phpmailer->Body, ENT_QUOTES);
381
- // Clean < and > around text links in WP 3.1
382
- $phpmailer->Body = $this->esc_textlinks($phpmailer->Body);
383
- // Convert line breaks & make links clickable
384
- $phpmailer->Body = nl2br(make_clickable($phpmailer->Body));
385
- // Add template to message
386
- $phpmailer->Body = $this->set_email_template($phpmailer->Body);
387
  // Replace variables in email
388
- $phpmailer->Body = $this->template_vars_replacement($phpmailer->Body);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
389
  }
390
 
391
  /**
@@ -395,8 +483,8 @@ if (!class_exists('WP_Better_Emails')) {
395
  * @param string $body
396
  * @return string
397
  */
398
- function esc_textlinks($body) {
399
- return preg_replace('#<(https?://[^*]+)>#', '$1', $body);
400
  }
401
 
402
  /**
@@ -408,20 +496,21 @@ if (!class_exists('WP_Better_Emails')) {
408
  * @param string $screen_id
409
  * @param string $screen
410
  */
411
- function contextual_help($contextual_help, $screen_id, $screen) {
412
- if (!$this->is_wpbe_page())
413
  return $contextual_help;
414
- return '<p>' . __('Some dynamic tags can be included in your email template :', 'wp-better-emails') . '</p>
 
415
  <ul>
416
- <li>' . __('<strong>%content%</strong> : will be replaced with the message content.', 'wp-better-emails') . '<br />
417
- <span class="description"> ' . __('NOTE: The content tag is <strong>required</strong>, WP Better Emails will be automatically desactivated if no content tag is found.', 'wp-better-emails') . '</span></li>
418
- <li>' . __('<strong>%blog_url%</strong> : will be replaced with your blog URL.', 'wp-better-emails') . '</li>
419
- <li>' . __('<strong>%home_url%</strong> : will be replaced with your home URL.', 'wp-better-emails') . '</li>
420
- <li>' . __('<strong>%blog_name%</strong> : will be replaced with your blog name.', 'wp-better-emails') . '</li>
421
- <li>' . __('<strong>%blog_description%</strong> : will be replaced with your blog description.', 'wp-better-emails') . '</li>
422
- <li>' . __('<strong>%admin_email%</strong> : will be replaced with admin email.', 'wp-better-emails') . '</li>
423
- <li>' . __('<strong>%date%</strong> : will be replaced with current date, as formatted in <a href="options-general.php">general options</a>.', 'wp-better-emails') . '</li>
424
- <li>' . __('<strong>%time%</strong> : will be replaced with current time, as formatted in <a href="options-general.php">general options</a>.', 'wp-better-emails') . '</li>
425
  </ul>';
426
  }
427
 
@@ -431,99 +520,134 @@ if (!class_exists('WP_Better_Emails')) {
431
  * Editing HTML emails requires some more plugins from TinyMCE:
432
  * - fullpage to handle html, meta, body tags
433
  * - codemirror for editing source
434
- *
435
  * @since 0.2
436
  * @param array $external_plugins
437
  * @return array
438
  */
439
- function tinymce_plugins($external_plugins) {
440
  global $wp_version;
441
- if (!$this->is_wpbe_page())
 
442
  return $external_plugins;
443
 
444
  $fullpage = array();
445
- if (version_compare($wp_version, '3.2', '<'))
446
- $fullpage = array('fullpage' => plugins_url('tinymce-plugins/3.3.x/fullpage/editor_plugin.js', __FILE__));
447
- else
448
- $fullpage = array('fullpage' => plugins_url('tinymce-plugins/3.4.x/fullpage/editor_plugin.js', __FILE__));
449
 
450
- $cmseditor = array('cmseditor' => plugins_url('tinymce-plugins/cmseditor/editor_plugin.js', __FILE__));
 
 
 
 
 
 
 
 
 
 
 
 
 
451
  $external_plugins = $external_plugins + $fullpage + $cmseditor;
 
452
  return $external_plugins;
453
  }
454
 
455
  /**
456
  * Button to the TinyMCE toolbar
457
- *
458
  * @since 0.2
459
  * @global string $page
460
  * @global type $page_hook
461
  * @param type $buttons
462
- * @return type
463
  */
464
- function tinymce_buttons($buttons) {
465
- if ($this->is_wpbe_page())
466
- array_push($buttons, 'cmseditor');
 
467
  return $buttons;
468
  }
469
 
470
  /**
471
  * Prevent TinyMCE from removing line breaks
472
- *
473
  * @param array $init
474
- * @return boolean
475
  */
476
- function tinymce_config($init) {
477
- if (!$this->is_wpbe_page())
478
  return $init;
 
479
  $init['remove_linebreaks'] = false;
480
- $init['content_css'] = ''; // WP =< 3.0
481
- if ( isset($init['extended_valid_elements']) )
 
482
  $init['extended_valid_elements'] = $init['extended_valid_elements'] . ',td[*]';
 
483
  return $init;
484
  }
485
 
486
  /**
487
  * Load WP tinyMCE editor
488
- *
489
  * @since 0.2
490
  */
491
  function load_wp_tiny_mce() {
492
- if (!$this->is_wpbe_page())
493
  return;
 
494
  $settings = array(
495
  'editor_selector' => 'wpbe_template',
496
- 'height' => '400'
497
  );
498
- wp_tiny_mce(false, $settings);
 
499
  }
500
 
501
  /**
502
  * Print WP TinyMCE editor to edit template
503
- *
504
  * @since 0.2
505
  * @global string $wp_version
506
  */
507
  function template_editor() {
508
  global $wp_version;
509
 
510
- if (version_compare($wp_version, '3.2.1', '<=')) {
511
  ?>
512
  <textarea id="wpbe_template" class="wpbe_template" name="wpbe_options[template]" cols="80" rows="10"><?php echo $this->options['template']; ?></textarea>
513
  <?php
514
  } else {
515
  // WP >= 3.3
516
- $settings = array('wpautop' => false, 'editor_class' => 'wpbe_template', 'quicktags' => false);
517
- wp_editor($this->options['template'], 'wpbe_options[template]', $settings);
 
 
 
 
 
518
  }
519
  }
520
 
 
 
 
 
 
 
 
 
 
 
 
 
 
521
  }
522
 
523
  }
524
 
525
- if (class_exists('WP_Better_Emails')) {
526
  $wp_better_emails = new WP_Better_Emails();
527
- register_activation_hook(__FILE__, array($wp_better_emails, 'install'));
528
  }
529
  ?>
3
  Plugin Name: WP Better Emails
4
  Plugin URI: http://wordpress.org/extend/plugins/wp-better-emails/
5
  Description: Beautify the default text/plain WP mails into fully customizable HTML emails.
6
+ Version: 0.2.5
7
  Author: ArtyShow
8
  Author URI: http://wordpress.org/extend/plugins/wp-better-emails/
9
  License: GPLv2
27
  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
28
  */
29
 
30
+ if ( ! class_exists( 'WP_Better_Emails' ) ) {
31
 
32
+ if ( ! defined( 'WPBE_JS_URL' ) )
33
+ define( 'WPBE_JS_URL', plugin_dir_url( __FILE__ ) . 'js' );
34
+
35
+ if ( ! defined( 'WPBE_CSS_URL' ) )
36
+ define( 'WPBE_CSS_URL', plugin_dir_url( __FILE__ ) . 'css' );
37
 
38
  class WP_Better_Emails {
39
 
40
  var $options = array();
41
  var $page = '';
42
+ var $send_as_html;
43
 
44
  /**
45
  * Construct function (old way)
46
+ *
47
  * @since 0.2
48
  */
49
  function WP_Better_Emails() {
52
 
53
  /**
54
  * Construct function
55
+ *
56
  * @since 0.2
57
  */
58
  function __construct() {
59
  global $wp_version;
60
+
61
  $this->get_options();
62
+
63
  // Front end filter
64
+ add_filter( 'wp_mail_from_name', array( $this, 'set_from_name' ) );
65
+ add_filter( 'wp_mail_from', array( $this, 'set_from_email' ) );
66
+ add_filter( 'wp_mail_content_type', array( $this, 'set_content_type'), 100 );
67
+ add_action('phpmailer_init', array(&$this, 'send_html'));
68
 
69
+ if ( ! is_admin() )
70
  return;
71
 
72
  // Load translations
73
+ load_plugin_textdomain( 'wp-better-emails', null, basename( dirname( __FILE__ ) ) . '/langs/' );
74
 
75
  // Actions
76
+ add_action( 'admin_init', array( $this, 'init' ) );
77
+ add_action( 'admin_menu', array( $this, 'admin_menu' ) );
78
+ add_action( 'wp_ajax_send_preview', array( $this, 'ajax_send_preview' ) );
79
+
80
+ if ( version_compare( $wp_version, '3.2.1', '<=' ) )
81
+ add_action( 'admin_head', array( $this, 'load_wp_tiny_mce' ) );
82
+
83
+ if ( version_compare( $wp_version, '3.2', '<' ) && version_compare( $wp_version, '3.0.6', '>' ) )
84
+ add_action( 'admin_print_footer_scripts', 'wp_tiny_mce_preload_dialogs' );
85
+
86
  // Filters
87
+ add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), array( $this, 'settings_link' ) );
88
+ add_filter( 'contextual_help', array( $this, 'contextual_help' ), 10, 3 );
89
+ add_filter( 'mce_external_plugins', array( $this, 'tinymce_plugins' ) );
90
+ add_filter( 'mce_buttons', array( $this, 'tinymce_buttons' ) );
91
+ add_filter( 'tiny_mce_before_init', array( $this, 'tinymce_config' ) );
92
  }
93
 
94
  /**
95
  * Get recorded options
96
+ *
97
  * @since 0.2
98
  */
99
  function get_options() {
100
+ $this->options = get_option( 'wpbe_options' );
101
  }
102
 
103
  /**
104
  * Set the default options
105
+ *
106
  * @since 0.2
107
  */
108
  function set_options() {
109
+
110
+ // HTML default template
111
  $template = '';
112
+ @require( 'templates/template-1.php' );
113
+
114
+ // Plain-text default template
115
+ $plaintext = '%content%
116
+
117
+ ---
118
+
119
+ Email sent %date% @ %time%
120
+ For any requests, please contact %admin_email%';
121
+
122
+ // Setup options array
123
  $this->options = array(
124
+ 'from_email' => '',
125
+ 'from_name' => '',
126
+ 'template' => $template,
127
+ 'plaintext_template' => $plaintext
128
  );
129
+
130
+ // If option doesn't exist, save default option
131
+ if ( get_option( 'wpbe_options' ) === null ) {
132
+ add_option( 'wpbe_options', $this->options );
133
+ }
134
  }
135
 
136
  /**
139
  * @since 0.1
140
  */
141
  function init() {
142
+ register_setting( 'wpbe_full_options', 'wpbe_options', array( $this, 'validate_options' ) );
143
+ wp_register_script( 'wpbe-admin-script', WPBE_JS_URL . '/wpbe-admin-script.js', array( 'jquery', 'thickbox' ), null, true );
144
+ wp_register_style( 'wpbe-admin-style', WPBE_CSS_URL . '/wpbe-admin-style.css' );
145
  }
146
 
147
  /**
152
  * @param array $links Plugin links
153
  * @return array Plugins links with settings added
154
  */
155
+ function settings_link( $links ) {
156
+ $links[] = '<a href="options-general.php?page=wpbe_options">' . __( 'Settings', 'wp-better-emails' ) . '</a>';
157
+
158
  return $links;
159
  }
160
 
168
  global $wp_version;
169
  // Prevent activation if requirements are not met
170
  // WP 2.8 required
171
+ if ( version_compare( $wp_version, '2.8', '<=' ) ) {
172
+ deactivate_plugins( __FILE__ );
173
+
174
+ wp_die( __( 'WP Better Emails requires WordPress 2.8 or newer.', 'wp-better-emails' ), __( 'Upgrade your Wordpress installation.', 'wp-better-emails' ) );
175
  }
176
+
177
  $this->set_options();
178
  }
179
 
183
  * @since 0.1
184
  */
185
  function admin_menu() {
186
+ $this->page = add_options_page( __( 'Email settings', 'wp-better-emails' ), __( 'WP Better Emails', 'wp-better-emails' ), 'administrator', 'wpbe_options', array( $this, 'admin_page' ) );
187
+
188
+ add_action('admin_print_scripts-' . $this->page, array( $this, 'admin_print_script' ) );
189
+ add_action( 'admin_print_styles-' . $this->page, array( $this, 'admin_print_style' ) );
190
  }
191
 
192
  /**
193
  * Check if we're on the plugin page
194
+ *
195
  * @since 0.2
196
  * @global type $page_hook
197
+ * @return type
198
  */
199
  function is_wpbe_page() {
200
  global $page_hook;
201
+
202
+ if ( $page_hook === $this->page )
203
  return true;
204
+
205
  return false;
206
  }
207
 
212
  * @since 0.1
213
  */
214
  function admin_print_script() {
215
+ wp_enqueue_script( 'wpbe-admin-script' );
216
+
217
+ $protocol = isset( $_SERVER["HTTPS"] ) ? 'https://' : 'http://';
218
+
219
  $ajax_vars = array(
220
+ 'url' => admin_url( 'admin-ajax.php', $protocol ),
221
+ 'nonce' => wp_create_nonce( 'email_preview' ),
222
  'action' => 'send_preview'
223
  );
224
+
225
+ wp_localize_script( 'wpbe-admin-script', 'wpbe_ajax_vars', $ajax_vars );
226
  }
227
 
228
  /**
231
  * @since 0.1
232
  */
233
  function admin_print_style() {
234
+ wp_enqueue_style( 'wpbe-admin-style' );
235
+ wp_enqueue_style( 'thickbox' );
236
  }
237
 
238
  /**
243
  */
244
  function admin_page() {
245
  global $wp_version;
246
+
247
+ require( 'wpbe-options.php' );
248
  }
249
 
250
  /**
254
  * @param array $input The options returned by the options page
255
  * @return array $input Sanitized values
256
  */
257
+ function validate_options( $input ) {
258
 
259
+ $from_email = strtolower( $input['from_email'] );
260
 
261
  // Checking emails
262
+ if ( ! empty( $from_email ) && ! is_email( $from_email ) ) {
263
+ add_settings_error( 'wpbe_options', 'settings_updated', __( 'Please enter a valid sender email address.', 'wp-better-emails' ), 'error' );
264
  $input['from_email'] = '';
265
  } else {
266
+ $input['from_email'] = sanitize_email( $from_email );
267
  }
268
 
269
  // Check name
270
+ $input['from_name'] = esc_html( $input['from_name'] );
271
+
272
+ /** Check HTML template *****************************************/
273
+
274
+ // Template is empty
275
+ if ( empty( $input['template'] ) ) {
276
+ add_settings_error( 'wpbe_options', 'settings_updated', __( 'Template is empty', 'wp-better-emails' ) );
277
 
 
 
278
  // Check if %content% tag is the template body
279
+ } elseif ( strpos( $input['template'], '%content%' ) === false ) {
280
+ add_settings_error( 'wpbe_options', 'settings_updated', __( 'No content tag found. The %content% tag is required in your template', 'wp-better-emails' ) );
281
+ }
282
+
283
  $input['template'] = $input['template'];
284
 
285
+ /** Check plain-text template ***********************************/
286
+
287
+ // Template is empty
288
+ if ( empty( $input['plaintext_template'] ) ) {
289
+ add_settings_error( 'wpbe_options', 'settings_updated', __( 'Plain-text template is empty', 'wp-better-emails' ) );
290
+
291
+ // Check if %content% tag is the template body
292
+ } elseif ( strpos( $input['plaintext_template'], '%content%' ) === false ) {
293
+ add_settings_error( 'wpbe_options', 'settings_updated', __( 'No content tag found. The %content% tag is required in your plain-text template', 'wp-better-emails' ) );
294
+ }
295
+
296
+ $input['plaintext_template'] = $input['plaintext_template'];
297
+
298
+
299
  return $input;
300
  }
301
 
305
  * @since 0.1
306
  * @param string $email
307
  */
308
+ function ajax_send_preview( $email ) {
309
+ if ( ! current_user_can( 'manage_options' ) )
310
  die();
311
+
312
+ check_ajax_referer( 'email_preview' );
313
+
314
+ $preview_email = sanitize_email( $_POST['preview_email'] );
315
+
316
+ if ( empty( $preview_email ) )
317
+ die( '<div class="error"><p>' . __( 'Please enter an email', 'wp-better-emails') . '</p></div>' );
318
+
319
+ if ( ! is_email( $preview_email ) )
320
+ die( '<div class="error"><p>' . __( 'Please enter a valid email', 'wp-better-emails' ) . '</p></div>' );
321
+
322
+ // Setup preview message content
323
+ $message = __( 'Hey !', 'wp-better-emails' );
324
  $message .= "\r\n\r\n";
325
+ $message .= __( 'This is a sample email to test your HTML template.', 'wp-better-emails' );
326
  $message .= "\r\n\r\n";
327
+ $message .= __( 'If you\'re not skilled in HTML/CSS email coding, I strongly recommend to leave the default template as it is. It has been tested on various and popular email clients like Gmail, Yahoo Mail, Hotmail/Live, Thunderbird, Apple Mail, Outlook, and many more.', 'wp-better-emails' );
328
  $message .= "\r\n\r\n";
329
+ $message .= __( 'If you have any problems or any suggestions to improve this plugin, please let me know.', 'wp-better-emails' );
330
  $message .= "\r\n\r\n";
331
+
332
+ // Send the preview email
333
+ if ( wp_mail( $preview_email, '[' . wp_specialchars_decode( get_option('blogname'), ENT_QUOTES ) . '] - ' . __( 'Email template preview', 'wp-better-emails' ), $message ) ) {
334
+ die( '<div class="updated"><p>' . sprintf( __( 'An email preview has been successfully sent to %s' , 'wp-better-emails' ), esc_attr( $preview_email ) ) . '</p></div>' );
335
+ } else {
336
+ die( '<div class="error"><p>' . __( 'An error occured while sending email. Please check your server configuration.', 'wp-better-emails' ) . '</p></div>' );
337
+ }
338
  }
339
 
340
  /**
344
  * @param string $template Template with variables
345
  * @return string Template with variables replaced
346
  */
347
+ function template_vars_replacement( $template ) {
348
  $to_replace = array(
349
+ 'blog_url' => get_option('siteurl'),
350
+ 'home_url' => get_option('home'),
351
+ 'blog_name' => get_option('blogname'),
352
+ 'blog_description' => get_option('blogdescription'),
353
+ 'admin_email' => get_option('admin_email'),
354
+ 'date' => date_i18n(get_option('date_format')),
355
+ 'time' => date_i18n(get_option('time_format'))
356
  );
357
  $to_replace = apply_filters('wpbe_tags', $to_replace);
358
+
359
+ foreach ( $to_replace as $tag => $var ) {
360
+ $template = str_replace( '%' . $tag . '%', $var, $template );
361
+ }
362
+
363
  return $template;
364
  }
365
 
370
  * @return bool
371
  */
372
  function check_template() {
373
+ if ( strpos( $this->options['template'], '%content%' ) === false || empty( $this->options['template'] ) )
374
  return false;
375
+
376
  return true;
377
  }
378
 
379
  /**
380
+ * Add the template to the message body.
381
+ *
382
+ * Looks for %message% into the template and replaces it with the message.
383
  *
384
  * @since 0.1
385
  * @param string $body The message to templatize
386
+ * @param string $type The type of template to use. Defaults to 'template', which is HTML.
387
+ * Use 'plaintext_template' to use the plain-text template.
388
  * @return string $email The email surrounded by template
389
  */
390
+ function set_email_template( $body, $type = 'template' ) {
391
  $template = '';
392
+
393
+ if ( isset( $this->options[$type] ) && ! empty( $this->options[$type] ) ) {
394
+ $template .= $this->options[$type];
395
+ }
396
+
397
+ return str_replace( '%content%', $body, $template );
398
  }
399
 
400
  /**
402
  *
403
  * @since 0.1
404
  * @param string $from_email
405
+ * @return string
406
  */
407
+ function set_from_email( $from_email ) {
408
+ if ( ! empty( $this->options['from_email']) && is_email( $this->options['from_email'] ) )
409
  return $this->options['from_email'];
410
+
411
  return $from_email;
412
  }
413
 
418
  * @param string $from_name
419
  * @return string
420
  */
421
+ function set_from_name( $from_name ) {
422
+ if ( ! empty( $this->options['from_name'] ) )
423
+ return wp_specialchars_decode( $this->options['from_name'], ENT_QUOTES );
424
+
425
  return $from_name;
426
  }
427
 
432
  * @param string $content_type
433
  * @return string $content_type
434
  */
435
+ function set_content_type( $content_type ) {
436
  // Only convert if the message is text/plain and the template is ok
437
+ if ( $content_type == 'text/plain' && $this->check_template() === true ) {
438
+ $this->send_as_html = true;
439
+ return $content_type = 'text/html';
440
+ } else {
441
+ $this->send_as_html = false;
442
  }
443
  return $content_type;
444
  }
445
 
446
  /**
447
+ * Add the email template and set it as multipart.
448
  *
449
  * @since 0.1
450
  * @param object $phpmailer
451
  */
452
+ function send_html( $phpmailer ) {
453
+ /** Plain-text **************************************************/
454
+ // Decode body
455
+ $phpmailer->AltBody = wp_specialchars_decode( $phpmailer->Body, ENT_QUOTES );
456
+
457
+ // Add plain-text template to message
458
+ $phpmailer->AltBody = $this->set_email_template( $phpmailer->AltBody, 'plaintext_template' );
459
+
 
460
  // Replace variables in email
461
+ $phpmailer->AltBody = apply_filters( 'wpbe_plaintext_body', $this->template_vars_replacement( $phpmailer->AltBody ) );
462
+
463
+ if ( $this->send_as_html ) {
464
+ /** HTML ********************************************************/
465
+ // Clean < and > around text links in WP 3.1
466
+ $phpmailer->Body = $this->esc_textlinks( $phpmailer->Body );
467
+
468
+ // Convert line breaks & make links clickable
469
+ $phpmailer->Body = nl2br( make_clickable( $phpmailer->Body ) );
470
+
471
+ // Add template to message
472
+ $phpmailer->Body = $this->set_email_template( $phpmailer->Body );
473
+
474
+ // Replace variables in email
475
+ $phpmailer->Body = apply_filters( 'wpbe_html_body', $this->template_vars_replacement( $phpmailer->Body ) );
476
+ }
477
  }
478
 
479
  /**
483
  * @param string $body
484
  * @return string
485
  */
486
+ function esc_textlinks( $body ) {
487
+ return preg_replace( '#<(https?://[^*]+)>#', '$1', $body );
488
  }
489
 
490
  /**
496
  * @param string $screen_id
497
  * @param string $screen
498
  */
499
+ function contextual_help( $contextual_help, $screen_id, $screen ) {
500
+ if ( ! $this->is_wpbe_page() )
501
  return $contextual_help;
502
+
503
+ return '<p>' . __( 'Some dynamic tags can be included in your email template :', 'wp-better-emails' ) . '</p>
504
  <ul>
505
+ <li>' . __( '<strong>%content%</strong> : will be replaced with the message content.', 'wp-better-emails' ) . '<br />
506
+ <span class="description"> ' . __( 'NOTE: The content tag is <strong>required</strong>, WP Better Emails will be automatically desactivated if no content tag is found.', 'wp-better-emails' ) . '</span></li>
507
+ <li>' . __( '<strong>%blog_url%</strong> : will be replaced with your blog URL.', 'wp-better-emails' ) . '</li>
508
+ <li>' . __( '<strong>%home_url%</strong> : will be replaced with your home URL.', 'wp-better-emails' ) . '</li>
509
+ <li>' . __( '<strong>%blog_name%</strong> : will be replaced with your blog name.', 'wp-better-emails' ) . '</li>
510
+ <li>' . __( '<strong>%blog_description%</strong> : will be replaced with your blog description.', 'wp-better-emails' ) . '</li>
511
+ <li>' . __( '<strong>%admin_email%</strong> : will be replaced with admin email.', 'wp-better-emails' ) . '</li>
512
+ <li>' . __( '<strong>%date%</strong> : will be replaced with current date, as formatted in <a href="options-general.php">general options</a>.', 'wp-better-emails' ) . '</li>
513
+ <li>' . __( '<strong>%time%</strong> : will be replaced with current time, as formatted in <a href="options-general.php">general options</a>.', 'wp-better-emails' ) . '</li>
514
  </ul>';
515
  }
516
 
520
  * Editing HTML emails requires some more plugins from TinyMCE:
521
  * - fullpage to handle html, meta, body tags
522
  * - codemirror for editing source
523
+ *
524
  * @since 0.2
525
  * @param array $external_plugins
526
  * @return array
527
  */
528
+ function tinymce_plugins( $external_plugins ) {
529
  global $wp_version;
530
+
531
+ if ( ! $this->is_wpbe_page() )
532
  return $external_plugins;
533
 
534
  $fullpage = array();
 
 
 
 
535
 
536
+ if ( version_compare( $wp_version, '3.2', '<' ) ) {
537
+ $fullpage = array(
538
+ 'fullpage' => plugins_url( 'tinymce-plugins/3.3.x/fullpage/editor_plugin.js', __FILE__ )
539
+ );
540
+ } else {
541
+ $fullpage = array(
542
+ 'fullpage' => plugins_url( 'tinymce-plugins/3.4.x/fullpage/editor_plugin.js', __FILE__ )
543
+ );
544
+ }
545
+
546
+ $cmseditor = array(
547
+ 'cmseditor' => plugins_url( 'tinymce-plugins/cmseditor/editor_plugin.js', __FILE__ )
548
+ );
549
+
550
  $external_plugins = $external_plugins + $fullpage + $cmseditor;
551
+
552
  return $external_plugins;
553
  }
554
 
555
  /**
556
  * Button to the TinyMCE toolbar
557
+ *
558
  * @since 0.2
559
  * @global string $page
560
  * @global type $page_hook
561
  * @param type $buttons
562
+ * @return type
563
  */
564
+ function tinymce_buttons( $buttons ) {
565
+ if ( $this->is_wpbe_page() )
566
+ array_push( $buttons, 'cmseditor' );
567
+
568
  return $buttons;
569
  }
570
 
571
  /**
572
  * Prevent TinyMCE from removing line breaks
573
+ *
574
  * @param array $init
575
+ * @return boolean
576
  */
577
+ function tinymce_config( $init ) {
578
+ if ( ! $this->is_wpbe_page() )
579
  return $init;
580
+
581
  $init['remove_linebreaks'] = false;
582
+ $init['content_css'] = ''; // WP =< 3.0
583
+
584
+ if ( isset( $init['extended_valid_elements'] ) )
585
  $init['extended_valid_elements'] = $init['extended_valid_elements'] . ',td[*]';
586
+
587
  return $init;
588
  }
589
 
590
  /**
591
  * Load WP tinyMCE editor
592
+ *
593
  * @since 0.2
594
  */
595
  function load_wp_tiny_mce() {
596
+ if ( ! $this->is_wpbe_page() )
597
  return;
598
+
599
  $settings = array(
600
  'editor_selector' => 'wpbe_template',
601
+ 'height' => '400'
602
  );
603
+
604
+ wp_tiny_mce( false, $settings );
605
  }
606
 
607
  /**
608
  * Print WP TinyMCE editor to edit template
609
+ *
610
  * @since 0.2
611
  * @global string $wp_version
612
  */
613
  function template_editor() {
614
  global $wp_version;
615
 
616
+ if ( version_compare( $wp_version, '3.2.1', '<=' ) ) {
617
  ?>
618
  <textarea id="wpbe_template" class="wpbe_template" name="wpbe_options[template]" cols="80" rows="10"><?php echo $this->options['template']; ?></textarea>
619
  <?php
620
  } else {
621
  // WP >= 3.3
622
+ $settings = array(
623
+ 'wpautop' => false,
624
+ 'editor_class' => 'wpbe_template',
625
+ 'quicktags' => false
626
+ );
627
+
628
+ wp_editor( $this->options['template'], 'wpbe_options[template]', $settings );
629
  }
630
  }
631
 
632
+ /**
633
+ * Print plain-text textarea field to edit template.
634
+ *
635
+ * @since 0.2.x
636
+ */
637
+ function plaintext_template_editor() {
638
+ ?>
639
+
640
+ <textarea id="wpbe_plaintext_template" class="wpbe_template" name="wpbe_options[plaintext_template]" cols="120" rows="10"><?php echo $this->options['plaintext_template']; ?></textarea>
641
+
642
+ <?php
643
+ }
644
+
645
  }
646
 
647
  }
648
 
649
+ if ( class_exists( 'WP_Better_Emails' ) ) {
650
  $wp_better_emails = new WP_Better_Emails();
651
+ register_activation_hook( __FILE__, array( $wp_better_emails, 'install' ) );
652
  }
653
  ?>