mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-21 13:54:02 -07:00
Added ability to select email type in mass email (#624)
* Added ability to select email type in mass email * Added text / html type selector. * Return back constants
This commit is contained in:
parent
94c63257f3
commit
aa9d02d41f
4 changed files with 15 additions and 3 deletions
|
@ -23,6 +23,7 @@ set_time_limit(1200);
|
||||||
$subject = (string)trim(request_var('subject', ''));
|
$subject = (string)trim(request_var('subject', ''));
|
||||||
$message = (string)request_var('message', '');
|
$message = (string)request_var('message', '');
|
||||||
$group_id = (int)request_var(POST_GROUPS_URL, 0);
|
$group_id = (int)request_var(POST_GROUPS_URL, 0);
|
||||||
|
$message_type = (string)request_var('message_type', '');
|
||||||
|
|
||||||
$errors = $user_id_sql = [];
|
$errors = $user_id_sql = [];
|
||||||
|
|
||||||
|
@ -78,7 +79,7 @@ if (isset($_POST['submit'])) {
|
||||||
'MESSAGE' => html_entity_decode($message),
|
'MESSAGE' => html_entity_decode($message),
|
||||||
));
|
));
|
||||||
|
|
||||||
$emailer->send();
|
$emailer->send($message_type);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1966,6 +1966,8 @@ $lang['COMPOSE'] = 'Compose';
|
||||||
$lang['RECIPIENTS'] = 'Recipients';
|
$lang['RECIPIENTS'] = 'Recipients';
|
||||||
$lang['ALL_USERS'] = 'All Users';
|
$lang['ALL_USERS'] = 'All Users';
|
||||||
|
|
||||||
|
$lang['MASS_EMAIL_MESSAGE_TYPE'] = 'Email type';
|
||||||
|
|
||||||
$lang['EMAIL_SUCCESSFULL'] = 'Your message has been sent';
|
$lang['EMAIL_SUCCESSFULL'] = 'Your message has been sent';
|
||||||
$lang['CLICK_RETURN_MASSEMAIL'] = 'Click %sHere%s to return to the Mass Email form';
|
$lang['CLICK_RETURN_MASSEMAIL'] = 'Click %sHere%s to return to the Mass Email form';
|
||||||
|
|
||||||
|
|
|
@ -160,7 +160,7 @@ class Emailer
|
||||||
* @param string $email_format
|
* @param string $email_format
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function send($email_format = self::FORMAT_TEXT)
|
public function send(string $email_format = self::FORMAT_TEXT)
|
||||||
{
|
{
|
||||||
global $bb_cfg, $lang, $userdata;
|
global $bb_cfg, $lang, $userdata;
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<h1>{L_EMAIL}</h1>
|
<h1>{L_MASS_EMAIL}</h1>
|
||||||
|
|
||||||
<p>{L_MASS_EMAIL_EXPLAIN}</p>
|
<p>{L_MASS_EMAIL_EXPLAIN}</p>
|
||||||
<br />
|
<br />
|
||||||
|
@ -13,6 +13,15 @@
|
||||||
<td class="row1" align="right"><b>{L_RECIPIENTS}</b></td>
|
<td class="row1" align="right"><b>{L_RECIPIENTS}</b></td>
|
||||||
<td class="row2">{S_GROUP_SELECT}</td>
|
<td class="row2">{S_GROUP_SELECT}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="row1" align="right"><b>{L_MASS_EMAIL_MESSAGE_TYPE}</b></td>
|
||||||
|
<td class="row2">
|
||||||
|
<select name="message_type">
|
||||||
|
<option value="text/plain" selected="selected">text/plain</option>
|
||||||
|
<option value="text/html">text/html</option>
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="row1" align="right"><b>{L_SUBJECT}</b></td>
|
<td class="row1" align="right"><b>{L_SUBJECT}</b></td>
|
||||||
<td class="row2"><input type="text" name="subject" size="45" maxlength="100" style="width:98%" tabindex="2" class="post" value="{SUBJECT}" /></td>
|
<td class="row2"><input type="text" name="subject" size="45" maxlength="100" style="width:98%" tabindex="2" class="post" value="{SUBJECT}" /></td>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue