Latest articles
Latest articles of category




Newsletter.tpl


Newsletter.tpl is a module which has to be activated by the administrator, after the client's request in order to operate and it is created to provide useful information to the subscribers of the site.
After the administrator activation, a newsletter module appears at the global configuration menu.

this form is displayed in order to add the newsletter
<form method="POST" enctype="multipart/form-data">
  <table id="editArticles">
    <tr>
    <td >{t}Add recipients{/t} *</td><td>
    <select name="news_group" class="textFormElement">
            {html_options values=$the_groups output=$the_groups selected=$the_groups}</select>
        </td>
      </tr>
    <tr>
      <td>{t}Title{/t} *</td><td>
        <input name="news_title" type="text" class="textFormElement" value="{$news_title}" size="60" /></td>
      </tr>
    <tr>
      <td colspan="2">
      <textarea name="editor1">Initial text</textarea>
         {literal}
<script type="text/javascript">
    var editor = CKEDITOR.replace( 'editor1' );
    editor.setData( '<p>Intro text</p>' );
    CKFinder.SetupCKEditor( editor, '../../../includes/ckfinder' ) ;
</script>
{/literal}
</td>
    </tr>
    <tr >
      <td colspan="2" align="center">
      <input type="submit" name="send_newsletter" value="{t}Send{/t}" class="formButtonSubmit" />
      <input type="button" value="{t}Cancel{/t}" class="formButtonSubmit" onclick="history.back();"/>
            </td></tr>


  </table>
  <p></p>
  * : <i>{t}These fields are mandatory{/t}!</i>
</form>

 

Otherwise if a newsletter is already sent, it can be edited by the administrator and forwarded to new subscribers
{elseif $smarty.get.action eq 'edit'}
<form method="POST" enctype="multipart/form-data">
  <table id="editArticles">
    <tr>
    <td >{t}Add recipients{/t} *</td><td>
    <select name="edit_group" class="textFormElement">
            {html_options values=$the_groups output=$the_groups selected=$group}</select>
        </td>
      </tr>
    <tr>
      <td>{t}Title{/t} *</td><td>
        <input name="edit_title" type="text" class="textFormElement" value="{$title}" size="60" /></td>
      </tr>
    <tr>
      <td colspan="2">
    <textarea name="editor1">{$body}</textarea>
         {literal}
<script type="text/javascript">
    var editor = CKEDITOR.replace( 'editor1' );
    editor.setData( '<p>Intro text</p>' );
    CKFinder.SetupCKEditor( editor, '../../../includes/ckfinder' ) ;
</script>
{/literal}


</td>
    </tr>
    <tr >
      <td colspan="2" align="center">
      <input type="submit" name="resend_newsletter" value="{t}Re-Send{/t}" class="formButtonSubmit" />
      <input type="submit" name="save_newsletter" value="{t}Save{/t}" class="formButtonSubmit" />
      <input type="button" value="{t}Cancel{/t}" class="formButtonSubmit" onclick="history.back();"/>
            </td></tr>


  </table>
  <p></p>
  * : <i>{t}These fields are mandatory{/t}!</i>
</form>
{/if}
this is the archive-link of the newsletters which can be editable
 
{if $smarty.get.action eq ''}
<a href="newsletter.php?action=archive">{t}Newsletter archive{/t}</a>
this code block displays the archive of the newsletters

{if $smarty.get.action eq 'archive'}
    <table id="editArticles">
    <tr><td>{t}Newsletters{/t}</td><td>{t}Date{/t}</td><td>{t}Actions{/t}</td></tr>
    {section name=the_newsletters loop=$archive_id}
    <tr><td>{$archive_title[the_newsletters]}</td><td>{$archive_date[the_newsletters]|date_format:"%d/%m/%Y"}</td><td><a href="newsletter.php?action=edit&id={$archive_id[the_newsletters]}">{t}Edit{/t}</a> / <a href="newsletter.php?action=delete&id={$archive_id[the_newsletters]}" onclick="return confirmSubmit();"> {t}Delete{/t} </a></td></tr>
    {/section}
    </table>
    <p></p>
    <input type="button" value="{t}Cancel{/t}" class="formButtonSubmit" onclick="history.back();"/>
{/if}
Posted on: 23/03/2011