Merge branch 'CRM-14696-v2' of https://github.com/JKingsnorth/civicrm-core into CRM...
[civicrm-core.git] / templates / CRM / Admin / Form / Setting / Smtp.tpl
1 {*
2 +--------------------------------------------------------------------+
3 | CiviCRM version 4.5 |
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2014 |
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">
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>
29
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
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}
33
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 />
48 <span class="description">{ts}Enter the SMTP server (machine) name. EXAMPLE: smtp.example.com{/ts}</span>
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 />
54 <span class="description">{ts}The standard SMTP port is 25. You should only change that value if your SMTP server is running on a non-standard port.{/ts}</span>
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>
63 <tr class="crm-smtp-form-block-smtpUsername">
64 <td class="label">{$form.smtpUsername.label}</td>
65 <td>{$form.smtpUsername.html}</td>
66 </tr>
67 <tr class="crm-smtp-form-block-smtpPassword">
68 <td class="label">{$form.smtpPassword.label}</td>
69 <td>{$form.smtpPassword.html}<br />
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">
80 <tr class="crm-smtp-form-block-sendmail_path">
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>
86 <tr class="crm-smtp-form-block-sendmail_args">
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>
99 </div>
100
101 {literal}
102 <script type="text/javascript">
103 CRM.$(function($) {
104 var mailSetting = $("input[name='outBound_option']:checked").val( );
105
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}"
107
108 showHideMailOptions( $("input[name='outBound_option']:checked").val( ) ) ;
109
110 function showHideMailOptions( value ) {
111 switch( value ) {
112 case "0":
113 $("#bySMTP").show( );
114 $("#bySendmail").hide( );
115 $("#_qf_Smtp_refresh_test").show( );
116 if (mailSetting == '5') {
117 alert(archiveWarning);
118 }
119 break;
120 case "1":
121 $("#bySMTP").hide( );
122 $("#bySendmail").show( );
123 $("#_qf_Smtp_refresh_test").show( );
124 if (mailSetting == '5') {
125 alert(archiveWarning);
126 }
127 break;
128 case "3":
129 $('.mailoption').hide();
130 $("#_qf_Smtp_refresh_test").show( );
131 if (mailSetting == '5') {
132 alert(archiveWarning);
133 }
134 break;
135 default:
136 $("#bySMTP").hide( );
137 $("#bySendmail").hide( );
138 $("#_qf_Smtp_refresh_test").hide( );
139 }
140 }
141
142 $("input[name='outBound_option']").click( function( ) {
143 showHideMailOptions( $(this).val( ) );
144 });
145 });
146
147 </script>
148 {/literal}