private $_message;
private $_alt_message;
private $_html;
+ private $_word_wrap = 70;
private $_result;
private $_errors = array();
$this->_mail->CharSet = 'UTF-8';
$this->_mail->SetLanguage($i18n->getAbbrev());
- $this->_mail->WordWrap = 70;
+ if ( $preferences->pref_bool_wrap_mails ) {
+ $this->_mail->WordWrap = $this->_word_wrap;
+ } else {
+ $this->_word_wrap = 0;
+ }
}
/**
return $this->_message;
}
+ /**
+ * Get the message, wrapped
+ *
+ * @return string Wrapped message
+ */
+ public function getWrappedMessage()
+ {
+ if ( $this->_word_wrap > 0 ) {
+ return $this->_mail->wrapText(
+ $this->_message,
+ $this->_word_wrap
+ );
+ } else {
+ return $this->_message;
+ }
+ }
+
/**
* Sets the subject
*
case 'message':
return $this->getMessage();
break;
+ case 'wrapped_message':
+ return $this->getWrappedMessage();
+ break;
case 'html':
return $this->isHTML();
break;
'pref_linkedin' => '',
'pref_mail_sign' => "{NAME}\r\n\r\n{WEBSITE}\r\n{GOOGLEPLUS}\r\n{FACEBOOK}\r\n{TWITTER}\r\n{LINKEDIN}\r\n{VIADEO}",
/* New contribution script */
- 'pref_new_contrib_script' => ''
+ 'pref_new_contrib_script' => '',
+ 'pref_bool_wrap_mails' => true
);
/**
{if $mailing->html}
{$mailing->message}
{else}
- <pre>{$mailing->message|escape}</pre>
+ <pre>{$mailing->wrapped_message|escape}</pre>
{/if}
</div>
- </section>
\ No newline at end of file
+ </section>
{if $mailing->html}
{$mailing->message}
{else}
- <pre>{$mailing->message}</pre>
+ <pre>{$mailing->wrapped_message}</pre>
{/if}
</p>
</div>
<div>
<p>
<input type="submit" name="mailing_reset" class="button" id="btnback" value="{_T string="Modifiy mailing"}"/>
- <input type="submit" name="mailing_confirm" value="{_T string="Send"}"{if $GALETTE_MODE eq 'DEMO'} class="disabled" disabled="disabled"{/if}/>
+ <input type="submit" name="mailing_confirm" id="btnsend" value="{_T string="Send"}"{if $GALETTE_MODE eq 'DEMO'} class="disabled" disabled="disabled"{/if}/>
<input type="submit" id="btncancel" name="mailing_cancel" value="{_T string="Cancel mailing"}"/>
<input type="hidden" name="mailing_objet" value="{$mailing->subject}"/>
<input type="hidden" name="mailing_corps" value="{$mailing->message|escape}"/>
<input type="text" name="pref_email_newadh" id="pref_email_newadh" value="{$pref.pref_email_newadh}" maxlength="100" size="30"{if isset($required.pref_email_newadh) and $required.pref_email_newadh eq 1} required{/if}/>
</p>
<p>
- <label for="pref_bool_mailadh" class="bline tooltip" title="{_T string="Sends an email each time a new member registers online"}">{_T string="Send email to administrators ?"}</label>
+ <label for="pref_bool_mailadh" class="bline tooltip" title="{_T string="Sends an email each time a new member registers online"}">{_T string="Send email to administrators?"}</label>
<span class="tip">{_T string="Sends an email each time a new member registers online"}</span>
<input type="checkbox" name="pref_bool_mailadh" id="pref_bool_mailadh" value="1" {if $pref.pref_bool_mailadh eq 1}checked="checked"{/if}{if isset($required.pref_bool_mailadh) and $required.pref_bool_mailadh eq 1} required{/if}/>
</p>
<p>
- <label for="pref_editor_enabled" class="bline tooltip" title="{_T string="Should HTML editor be activated on page load ?"}">{_T string="Activate HTML editor ?"}</label>
+ <label for="pref_bool_wrap_mails" class="bline tooltip" title="{_T string="Automatically wrap text mails before sending"}">{_T string="Wrap text mails?"}</label>
+ <span class="tip">{_T string="Automatically wrap text mails before sending. Make sure to wrap yourself if you disable that. Please note that current editing mailing will not be affected by a change."}</span>
+ <input type="checkbox" name="pref_bool_wrap_mails" id="pref_bool_wrap_mails" value="1" {if $pref.pref_bool_wrap_mails eq 1}checked="checked"{/if}{if isset($required.pref_bool_wrap_mails) and $required.pref_bool_wrap_mails eq 1} required{/if}/>
+ </p>
+
+ <p>
+ <label for="pref_editor_enabled" class="bline tooltip" title="{_T string="Should HTML editor be activated on page load ?"}">{_T string="Activate HTML editor?"}</label>
<span class="tip">{_T string="Should HTML editor be activated on page load ?"}</span>
<input type="checkbox" name="pref_editor_enabled" id="pref_editor_enabled" value="1" {if $pref.pref_editor_enabled eq 1}checked="checked"{/if}{if isset($required.pref_editor_enabled) and $required.pref_editor_enabled eq 1} required{/if}/>
</p>