Merge pull request #4866 from totten/master-phpcs
[civicrm-core.git] / templates / CRM / Admin / Form / Setting / Smtp.tpl
CommitLineData
6a488035
TO
1{*
2 +--------------------------------------------------------------------+
39de6fd5 3 | CiviCRM version 4.6 |
6a488035 4 +--------------------------------------------------------------------+
819d0d41 5 | Copyright CiviCRM LLC (c) 2004-2014 |
6a488035
TO
6 +--------------------------------------------------------------------+
7 | This file is a part of CiviCRM. |
8 | |
9 | CiviCRM is free software; you can copy, modify, and distribute it |
10 | under the terms of the GNU Affero General Public License |
11 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
12 | |
13 | CiviCRM is distributed in the hope that it will be useful, but |
14 | WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
16 | See the GNU Affero General Public License for more details. |
17 | |
18 | You should have received a copy of the GNU Affero General Public |
19 | License and the CiviCRM Licensing Exception along |
20 | with this program; if not, contact CiviCRM LLC |
21 | at info[AT]civicrm[DOT]org. If you have questions about the |
22 | GNU Affero General Public License or the licensing of CiviCRM, |
23 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
24 +--------------------------------------------------------------------+
25*}
26<div class="crm-block crm-form-block crm-smtp-form-block">
27<div id="help">
edc51caa 28 {ts}<p>CiviCRM offers several options to send emails. The default option should work fine on linux systems. If you are using windows, you probably need to enter settings for your SMTP/Sendmail server. You can send a test email to check your settings by clicking "Save and Send Test Email". If you're unsure of the correct values, check with your system administrator, ISP or hosting provider.</p>
6a488035 29
303ef4fd
DG
30 <p>If you do not want users to send outbound mail from CiviCRM, select "Disable Outbound Email". NOTE: If you disable outbound email, and you are using Online Contribution pages or online Event Registration - you will need to disable automated receipts and registration confirmations.</p>
31
95f08210 32 <p>If you choose Redirect to Database, all emails will be recorded as archived mailings instead of being sent out. They can be found in the civicrm_mailing_spool table in the CiviCRM database.</p>{/ts}
303ef4fd 33
6a488035
TO
34</div>
35 <table class="form-layout-compressed">
36 <tr class="crm-smtp-form-block-outBound_option">
37 <td class="label">{$form.outBound_option.label}</td>
38 <td>{$form.outBound_option.html}</td>
39 </tr>
40 </table>
41 <div id="bySMTP" class="mailoption">
42 <fieldset>
43 <legend>{ts}SMTP Configuration{/ts}</legend>
44 <table class="form-layout-compressed">
45 <tr class="crm-smtp-form-block-smtpServer">
46 <td class="label">{$form.smtpServer.label}</td>
47 <td>{$form.smtpServer.html}<br />
d112cfe8 48 <span class="description">{ts}Enter the SMTP server (machine) name, such as "smtp.example.com". If the server uses SSL, add "ssl://" to the beginning of the server name, such as "ssl://smtp.example.com".{/ts}</span>
6a488035
TO
49 </td>
50 </tr>
51 <tr class="crm-smtp-form-block-smtpPort">
52 <td class="label">{$form.smtpPort.label}</td>
53 <td>{$form.smtpPort.html}<br />
d112cfe8 54 <span class="description">{ts}The most common SMTP port possibilities are 25, 465, and 587. Check with your mail provider for the appropriate one.{/ts}</span>
6a488035
TO
55 </td>
56 </tr>
57 <tr class="crm-smtp-form-block-smtpAuth">
58 <td class="label">{$form.smtpAuth.label}</td>
59 <td>{$form.smtpAuth.html}<br />
60 <span class="description">{ts}Does your SMTP server require authentication (user name + password)?{/ts}</span>
61 </td>
62 </tr>
edc51caa 63 <tr class="crm-smtp-form-block-smtpUsername">
6a488035
TO
64 <td class="label">{$form.smtpUsername.label}</td>
65 <td>{$form.smtpUsername.html}</td>
66 </tr>
edc51caa 67 <tr class="crm-smtp-form-block-smtpPassword">
6a488035 68 <td class="label">{$form.smtpPassword.label}</td>
edc51caa 69 <td>{$form.smtpPassword.html}<br />
6a488035
TO
70 <span class="description">{ts}If your SMTP server requires authentication, enter your Username and Password here.{/ts}</span>
71 </td>
72 </tr>
73 </table>
74 </fieldset>
75 </div>
76 <div id="bySendmail" class="mailoption">
77 <fieldset>
78 <legend>{ts}Sendmail Configuration{/ts}</legend>
79 <table class="form-layout-compressed">
edc51caa 80 <tr class="crm-smtp-form-block-sendmail_path">
6a488035
TO
81 <td class="label">{$form.sendmail_path.label}</td>
82 <td>{$form.sendmail_path.html}<br />
83 <span class="description">{ts}Enter the Sendmail Path. EXAMPLE: /usr/sbin/sendmail{/ts}</span>
84 </td>
85 </tr>
edc51caa 86 <tr class="crm-smtp-form-block-sendmail_args">
6a488035
TO
87 <td class="label">{$form.sendmail_args.label}</td>
88 <td>{$form.sendmail_args.html}</td>
89 </tr>
90 </table>
91 </fieldset>
92 </div>
93 <div class="spacer"></div>
94 <div class="crm-submit-buttons">
95 {include file="CRM/common/formButtons.tpl"}
96 <span class="place-left">&nbsp;</span>
97 <span class="crm-button crm-button-type-next crm-button_qf_Smtp_refresh_test">{$form._qf_Smtp_refresh_test.html}</span>
98 </div>
edc51caa 99</div>
6a488035
TO
100
101{literal}
102<script type="text/javascript">
3cc60a06 103 CRM.$(function($) {
ae8f569f 104 var mailSetting = $("input[name='outBound_option']:checked").val( );
32c8492f 105
18150396 106 var archiveWarning = "{/literal}{ts escape='js'}WARNING: You are switching from a testing mode (Redirect to Database) to a live mode. Check Mailings > Archived Mailings, and delete any test mailings that are not in Completed status prior to running the mailing cron job for the first time. This will ensure that test mailings are not actually sent out.{/ts}{literal}"
32c8492f 107
ae8f569f 108 showHideMailOptions( $("input[name='outBound_option']:checked").val( ) ) ;
edc51caa 109
6a488035
TO
110 function showHideMailOptions( value ) {
111 switch( value ) {
112 case "0":
ae8f569f
CW
113 $("#bySMTP").show( );
114 $("#bySendmail").hide( );
115 $("#_qf_Smtp_refresh_test").show( );
18150396
E
116 if (mailSetting == '5') {
117 alert(archiveWarning);
118 }
6a488035
TO
119 break;
120 case "1":
ae8f569f
CW
121 $("#bySMTP").hide( );
122 $("#bySendmail").show( );
123 $("#_qf_Smtp_refresh_test").show( );
18150396
E
124 if (mailSetting == '5') {
125 alert(archiveWarning);
126 }
6a488035
TO
127 break;
128 case "3":
ae8f569f
CW
129 $('.mailoption').hide();
130 $("#_qf_Smtp_refresh_test").show( );
18150396
E
131 if (mailSetting == '5') {
132 alert(archiveWarning);
133 }
6a488035
TO
134 break;
135 default:
ae8f569f
CW
136 $("#bySMTP").hide( );
137 $("#bySendmail").hide( );
138 $("#_qf_Smtp_refresh_test").hide( );
6a488035
TO
139 }
140 }
edc51caa 141
ae8f569f
CW
142 $("input[name='outBound_option']").click( function( ) {
143 showHideMailOptions( $(this).val( ) );
6a488035
TO
144 });
145 });
edc51caa 146
6a488035
TO
147</script>
148{/literal}