email template
This commit is contained in:
1 parent
101d8bc623
commit
e11fa6fa5b
10 files changed
+1367
-7127
No files matched your search
@@ -3,6 +3,10 @@
|
||||
* Reusable form fields for adding/editing prizes
|
||||
*/
|
||||
if (!defined('ABSPATH')) exit;
|
||||
|
||||
// Pridobi predloge (potrebno na strani, ki vključuje to datoteko)
|
||||
global $wpdb;
|
||||
$email_templates = $wpdb->get_results("SELECT id, name FROM {$wpdb->prefix}wheel_email_templates ORDER BY name ASC", ARRAY_A);
|
||||
?>
|
||||
<tr>
|
||||
<th scope="row"><label for="prize_name"><?php _e('Prize Name', 'wheel-of-fortune'); ?></label></th>
|
||||
@@ -28,6 +32,23 @@ if (!defined('ABSPATH')) exit;
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!-- DODAJ NOVA POLJA ZA FUNDED ACCOUNT -->
|
||||
<tr>
|
||||
<th scope="row"><label for="funded_account_name"><?php _e('Funded Account Name', 'wheel-of-fortune'); ?></label></th>
|
||||
<td>
|
||||
<input type="text" id="funded_account_name" name="funded_account_name" class="regular-text">
|
||||
<p class="description"><?php _e('e.g., Funded7 $50k. Used for the {funded_account_name} tag.', 'wheel-of-fortune'); ?></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="funded_account_value"><?php _e('Funded Account Value', 'wheel-of-fortune'); ?></label></th>
|
||||
<td>
|
||||
<input type="number" id="funded_account_value" name="funded_account_value" step="any" min="0">
|
||||
<p class="description"><?php _e('e.g., 50000. Used for the {funded_account_value} tag.', 'wheel-of-fortune'); ?></p>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th scope="row"><label for="prize_redemption_code"><?php _e('Redemption Code', 'wheel-of-fortune'); ?></label></th>
|
||||
<td>
|
||||
@@ -35,24 +56,42 @@ if (!defined('ABSPATH')) exit;
|
||||
<p class="description"><?php _e('Optional code for the user to redeem the prize.', 'wheel-of-fortune'); ?></p>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!-- SPREMENJENA EMAIL SEKCIJA -->
|
||||
<tr>
|
||||
<th scope="row"><label for="prize_email_subject"><?php _e('Email Subject', 'wheel-of-fortune'); ?></label></th>
|
||||
<th scope="row"><label for="prize_email_template_id"><?php _e('Email Content', 'wheel-of-fortune'); ?></label></th>
|
||||
<td>
|
||||
<select id="prize_email_template_id" name="email_template_id">
|
||||
<option value="0"><?php _e('-- Custom Email --', 'wheel-of-fortune'); ?></option>
|
||||
<?php foreach ($email_templates as $template) : ?>
|
||||
<option value="<?php echo esc_attr($template['id']); ?>"><?php echo esc_html($template['name']); ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<p class="description"><?php _e('Choose a pre-written template or select "Custom Email" to write your own below.', 'wheel-of-fortune'); ?></p>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tbody class="custom-email-fields">
|
||||
<tr>
|
||||
<th scope="row"><label for="prize_email_subject"><?php _e('Email Subject', 'wheel-of-fortune'); ?></label></th>
|
||||
<td>
|
||||
<input type="text" id="prize_email_subject" name="prize_email_subject" class="large-text">
|
||||
<p class="description"><?php _e('Subject for this prize\'s email. If empty, the default subject will be used.', 'wheel-of-fortune'); ?></p>
|
||||
<p class="description"><?php _e('Subject for this prize\'s email. Only used if "Custom Email" is selected.', 'wheel-of-fortune'); ?></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="prize_email_template"><?php _e('Email Template', 'wheel-of-fortune'); ?></label></th>
|
||||
<td>
|
||||
<textarea id="prize_email_template" name="prize_email_template" rows="10" class="large-text code"></textarea>
|
||||
<p class="description"><?php _e('Content for this prize\'s email. Leave blank for default template.', 'wheel-of-fortune'); ?></p>
|
||||
<p class="description"><?php _e('Content for this prize\'s email. Only used if "Custom Email" is selected.', 'wheel-of-fortune'); ?></p>
|
||||
<p><?php _e('Available template tags:', 'wheel-of-fortune'); ?></p>
|
||||
<ul class="wheel-template-tags">
|
||||
<li><code>{user_name}</code>, <code>{user_email}</code>, <code>{prize_name}</code>, <code>{prize_description}</code>, <code>{redemption_code}</code>, <code>{site_name}</code>, <code>{site_url}</code>, <code>{date}</code>, <code>{time}</code></li>
|
||||
<li><code>{user_name}</code>, <code>{user_email}</code>, <code>{prize_name}</code>, <code>{prize_description}</code>, <code>{redemption_code}</code>, <code>{site_name}</code>, <code>{site_url}</code>, <code>{date}</code>, <code>{time}</code>, <strong><code>{funded_account_name}</code></strong>, <strong><code>{funded_account_value}</code></strong></li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<tr>
|
||||
<th scope="row"><label for="prize_is_discount"><?php _e('Je discount?', 'wheel-of-fortune'); ?></label></th>
|
||||
<td>
|
||||
|
||||
Reference in new issue
Block a user