Add body text to newsletters

This commit is contained in:
JonnyWong16 2018-03-19 20:20:57 -07:00
commit 7e11af1fd0
8 changed files with 170 additions and 76 deletions

View file

@ -48,7 +48,7 @@ newsletter_log_table_options = {
$(td).html(cellData);
}
},
"width": "10%",
"width": "5%",
"className": "no-wrap"
},
{
@ -67,43 +67,53 @@ newsletter_log_table_options = {
"data": "subject_text",
"createdCell": function (td, cellData, rowData, row, col) {
if (cellData !== '') {
$(td).html('<a href="newsletter/' + rowData['uuid'] + '" target="_blank">' + cellData + '</a>');
$(td).html(cellData);
}
},
"width": "38%"
"width": "25%"
},
{
"targets": [5],
"data": "body_text",
"createdCell": function (td, cellData, rowData, row, col) {
if (cellData !== '') {
$(td).html(cellData);
}
},
"width": "33%"
},
{
"targets": [6],
"data": "start_date",
"createdCell": function (td, cellData, rowData, row, col) {
if (cellData !== '') {
$(td).html(cellData);
}
},
"width": "10%"
"width": "5%"
},
{
"targets": [6],
"targets": [7],
"data": "end_date",
"createdCell": function (td, cellData, rowData, row, col) {
if (cellData !== '') {
$(td).html(cellData);
}
},
"width": "10%"
},
{
"targets": [7],
"data": "uuid",
"createdCell": function (td, cellData, rowData, row, col) {
if (cellData !== '') {
$(td).html(cellData);
}
},
"width": "10%"
"width": "5%"
},
{
"targets": [8],
"data": "uuid",
"createdCell": function (td, cellData, rowData, row, col) {
if (cellData !== '') {
$(td).html('<a href="newsletter/' + rowData['uuid'] + '" target="_blank">' + cellData + '</a>');
}
},
"width": "5%"
},
{
"targets": [9],
"data": "success",
"createdCell": function (td, cellData, rowData, row, col) {
if (cellData === 1) {

View file

@ -152,6 +152,7 @@
<th align="left" id="newsletter_agent_name">Agent</th>
<th align="left" id="newsletter_notify_action">Action</th>
<th align="left" id="newsletter_subject_text">Subject Text</th>
<th align="left" id="newsletter_body_text">Body Text</th>
<th align="left" id="newsletter_start_date">Start Date</th>
<th align="left" id="newsletter_end_date">End Date</th>
<th align="left" id="newsletter_uuid">UUID</th>

View file

@ -176,10 +176,10 @@
<p class="help-block">Use an existing Email notification agent or enter a new configuration below.</p>
</div>
<div class="form-group">
<label for="email_subject">Email Subject</label>
<label for="subject">Subject</label>
<div class="row">
<div class="col-md-12">
<input type="text" class="form-control" id="email_subject" name="email_subject" value="${newsletter['email_config']['subject']}" size="30">
<input type="text" class="form-control" id="subject" name="subject" value="${newsletter['subject']}" size="30">
</div>
</div>
<p class="help-block">
@ -188,6 +188,19 @@
Note: You may include <span class="inline-pre">{server_name}</span>, <span class="inline-pre">{start_date}</span>, and <span class="inline-pre">{end_date}</span> as parameters. The global date format under Settings > General will be used.
</p>
</div>
<div class="form-group">
<label for="body">Body</label>
<div class="row">
<div class="col-md-12">
<input type="text" class="form-control" id="body" name="body" value="${newsletter['body']}" size="30">
</div>
</div>
<p class="help-block">
Optional: Enter a body line for the email. Leave blank for default.
<br>
Note: You may include <span class="inline-pre">{server_name}</span>, <span class="inline-pre">{start_date}</span>, and <span class="inline-pre">{end_date}</span> as parameters. The global date format under Settings > General will be used.
</p>
</div>
</div>
<div id="newsletter-email-config" class="col-md-12" style="padding-top: 10px; border-top: 1px solid #444; ${'display: none;' if newsletter['email_config']['notifier'] else ''}">
% for item in newsletter['email_config_options']: