-
civicrm/mailing/url
CRM_Mailing_Page_Url
diff --git a/CRM/Utils/Hook.php b/CRM/Utils/Hook.php
index a987971774b4..4eb7f470bcd1 100644
--- a/CRM/Utils/Hook.php
+++ b/CRM/Utils/Hook.php
@@ -1042,6 +1042,24 @@ public static function eventDiscount(&$form, &$params) {
);
}
+ /**
+ * When adding a new "Mail Account" (`MailSettings`), present a menu of setup
+ * options.
+ *
+ * @param array $setupActions
+ * Each item has a symbolic-key, and it has the properties:
+ * - title: string
+ * - callback: string|array, the function which starts the setup process.
+ * The function is expected to return a 'url' for the config screen.
+ * @return mixed
+ */
+ public static function mailSetupActions(&$setupActions) {
+ return self::singleton()->invoke(['setupActions'], $setupActions, self::$_nullObject, self::$_nullObject,
+ self::$_nullObject, self::$_nullObject, self::$_nullObject,
+ 'civicrm_mailSetupActions'
+ );
+ }
+
/**
* This hook is called when composing a mailing. You can include / exclude other groups as needed.
*
diff --git a/templates/CRM/Admin/Page/MailSettings.tpl b/templates/CRM/Admin/Page/MailSettings.tpl
index f7e2bde5c4b9..18f1d67148d3 100644
--- a/templates/CRM/Admin/Page/MailSettings.tpl
+++ b/templates/CRM/Admin/Page/MailSettings.tpl
@@ -58,9 +58,34 @@
{ts}None found.{/ts}
{/if}
-
- {crmButton q="action=add&reset=1" id="newMailSettings" icon="plus-circle"}{ts}Add Mail Account{/ts}{/crmButton}
- {crmButton p="civicrm/admin" q="reset=1" class="cancel" icon="times"}{ts}Done{/ts}{/crmButton}
-
+ {if $setupActions}
+
+ {else}
+
+ {crmButton q="action=add&reset=1" id="newMailSettings" icon="plus-circle"}{ts}Add Mail Account{/ts}{/crmButton}
+ {crmButton p="civicrm/admin" q="reset=1" class="cancel" icon="times"}{ts}Done{/ts}{/crmButton}
+
+ {/if}
+
{/if}
+{literal}
+
+{/literal}