| 1 | {* |
| 2 | +--------------------------------------------------------------------+ |
| 3 | | Copyright CiviCRM LLC. All rights reserved. | |
| 4 | | | |
| 5 | | This work is published under the GNU AGPLv3 license with some | |
| 6 | | permitted exceptions and without any warranty. For full license | |
| 7 | | and copyright information, see https://civicrm.org/licensing | |
| 8 | +--------------------------------------------------------------------+ |
| 9 | *} |
| 10 | <div class="crm-block crm-form-block crm-smtp-form-block"> |
| 11 | <div> |
| 12 | <h3>{ts}General{/ts}</h3> |
| 13 | <table class="form-layout-compressed"> |
| 14 | <tr class="crm-smtp-form-block-allow_mail_from_logged_in_contact"> |
| 15 | <td class="label">{$form.allow_mail_from_logged_in_contact.html}</td> |
| 16 | <td>{$form.allow_mail_from_logged_in_contact.label} {help id=allow_mail_contact_email}</td> |
| 17 | </tr> |
| 18 | </table> |
| 19 | </div> |
| 20 | {crmRegion name="smtp-mailer-config"} |
| 21 | <div class="crm-smtp-mailer-form-block"> |
| 22 | <h3>{ts}Mailer Configuration{/ts}</h3> |
| 23 | <div class="help"> |
| 24 | <p>{ts}CiviCRM offers several options to send emails. 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.{/ts}</p> |
| 25 | <p>{ts}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.{/ts}</p> |
| 26 | <p>{ts}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.{/ts}</p> |
| 27 | </div> |
| 28 | <table> |
| 29 | <tr class="crm-smtp-form-block-outBound_option"> |
| 30 | <td class="label">{$form.outBound_option.label}</td> |
| 31 | <td>{$form.outBound_option.html}</td> |
| 32 | </tr> |
| 33 | </table> |
| 34 | <div id="bySMTP" class="mailoption"> |
| 35 | <fieldset> |
| 36 | <legend>{ts}SMTP Configuration{/ts}</legend> |
| 37 | <table class="form-layout-compressed"> |
| 38 | <tr class="crm-smtp-form-block-smtpServer"> |
| 39 | <td class="label">{$form.smtpServer.label}</td> |
| 40 | <td>{$form.smtpServer.html}<br /> |
| 41 | <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> |
| 42 | </td> |
| 43 | </tr> |
| 44 | <tr class="crm-smtp-form-block-smtpPort"> |
| 45 | <td class="label">{$form.smtpPort.label}</td> |
| 46 | <td>{$form.smtpPort.html}<br /> |
| 47 | <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> |
| 48 | </td> |
| 49 | </tr> |
| 50 | <tr class="crm-smtp-form-block-smtpAuth"> |
| 51 | <td class="label">{$form.smtpAuth.label}</td> |
| 52 | <td>{$form.smtpAuth.html}<br /> |
| 53 | <span class="description">{ts}Does your SMTP server require authentication (user name + password)?{/ts}</span> |
| 54 | </td> |
| 55 | </tr> |
| 56 | <tr class="crm-smtp-form-block-smtpUsername"> |
| 57 | <td class="label">{$form.smtpUsername.label}</td> |
| 58 | <td>{$form.smtpUsername.html}</td> |
| 59 | </tr> |
| 60 | <tr class="crm-smtp-form-block-smtpPassword"> |
| 61 | <td class="label">{$form.smtpPassword.label}</td> |
| 62 | <td>{$form.smtpPassword.html}<br /> |
| 63 | <span class="description">{ts}If your SMTP server requires authentication, enter your Username and Password here.{/ts}</span> |
| 64 | </td> |
| 65 | </tr> |
| 66 | </table> |
| 67 | </fieldset> |
| 68 | </div> |
| 69 | <div id="bySendmail" class="mailoption"> |
| 70 | <fieldset> |
| 71 | <legend>{ts}Sendmail Configuration{/ts}</legend> |
| 72 | <table class="form-layout-compressed"> |
| 73 | <tr class="crm-smtp-form-block-sendmail_path"> |
| 74 | <td class="label">{$form.sendmail_path.label}</td> |
| 75 | <td>{$form.sendmail_path.html}<br /> |
| 76 | <span class="description">{ts}Enter the Sendmail Path. EXAMPLE: /usr/sbin/sendmail{/ts}</span> |
| 77 | </td> |
| 78 | </tr> |
| 79 | <tr class="crm-smtp-form-block-sendmail_args"> |
| 80 | <td class="label">{$form.sendmail_args.label}</td> |
| 81 | <td>{$form.sendmail_args.html}</td> |
| 82 | </tr> |
| 83 | </table> |
| 84 | </fieldset> |
| 85 | </div> |
| 86 | <div class="spacer"></div> |
| 87 | <div class="crm-submit-buttons"> |
| 88 | {include file="CRM/common/formButtons.tpl"} |
| 89 | </div> |
| 90 | |
| 91 | {literal} |
| 92 | <script type="text/javascript"> |
| 93 | CRM.$(function($) { |
| 94 | var mailSetting = $("input[name='outBound_option']:checked").val( ); |
| 95 | |
| 96 | 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}"; |
| 97 | |
| 98 | showHideMailOptions( $("input[name='outBound_option']:checked").val( ) ) ; |
| 99 | |
| 100 | function showHideMailOptions( value ) { |
| 101 | switch( value ) { |
| 102 | case "0": |
| 103 | $("#bySMTP").show( ); |
| 104 | $("#bySendmail").hide( ); |
| 105 | $("#_qf_Smtp_refresh_test").prop('disabled', false); |
| 106 | if (mailSetting == '5') { |
| 107 | alert(archiveWarning); |
| 108 | } |
| 109 | break; |
| 110 | case "1": |
| 111 | $("#bySMTP").hide( ); |
| 112 | $("#bySendmail").show( ); |
| 113 | $("#_qf_Smtp_refresh_test").prop('disabled', false); |
| 114 | if (mailSetting == '5') { |
| 115 | alert(archiveWarning); |
| 116 | } |
| 117 | break; |
| 118 | case "3": |
| 119 | $('.mailoption').hide(); |
| 120 | $("#_qf_Smtp_refresh_test").prop('disabled', false); |
| 121 | if (mailSetting == '5') { |
| 122 | alert(archiveWarning); |
| 123 | } |
| 124 | break; |
| 125 | default: |
| 126 | $("#bySMTP").hide( ); |
| 127 | $("#bySendmail").hide( ); |
| 128 | $("#_qf_Smtp_refresh_test").prop('disabled', true); |
| 129 | } |
| 130 | } |
| 131 | |
| 132 | $("input[name='outBound_option']").click( function( ) { |
| 133 | showHideMailOptions( $(this).val( ) ); |
| 134 | }); |
| 135 | }); |
| 136 | |
| 137 | </script> |
| 138 | {/literal} |
| 139 | </div> |
| 140 | {/crmRegion} |
| 141 | </div> |