8000 GitHub - ant-tar/modxDashaMail: DashaMail.ru MODX component
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

ant-tar/modxDashaMail

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DashaMail

DashaMail component gives your user subscription to the service, including Formit hook and Minishop2 order subscription in case you use it.

Installation

Install the extra via MODX package manager

Create API Key

Signup for an account on DashaMail and create an API key, here are more details.

System settings

Before using the hook, dashamail_api_key API key and dashamail_list_id list ID system settings must be specified. dashamail_merge_fields list is responsible for default field matching.

Example snippet call

[[!FormIt?
  &hooks=`dmSubscribe`
  &dmEmailField=`email-field-name`
  &dmlistId=`12345678`
  &dmMergeParams=`merge_1==name,merge_2==phone`
]]

Possible options which can be added to the FormIt snippet call

Parameter Description Default
dmEmailField The name of the email field in the form. email
dmlistId [optional] DashaMail list id to subscribe to default value stored in system setting dashamail_list_id
dmMergeParams [optional] The merge tags of Mailchimp combined with the form fields. More details can be found in API documentation. Empty by default, but may be set in dashamail_merge_fields setting.

Minishop2 order user subscription

Package includes default dmCheckbox snippet, it is responsible for user's consent subscription checkbox. Place it inside Minishop2 order form. Checkbox can be customized, see tpl default parameter or specify it directly.

[[!dmCheckbox?
  &tpl=`dmCheckboxTpl`
]]

Custom code subscription

If you need to subscribe user to DashaMail service somewhere else in the code, you can do it like this:

$dashamail = $modx->getService('dashamail','DashaMail',$modx->getOption('dashamail.core_path',null,$modx->getOption('core_path').'components/dashamail/').'model/dashamail/',[]);
if ($dashamail instanceof DashaMail) {
	$dm = new DashaMail($modx);
	$dm->addListMember('',$email);
}

Further plans

In next version it is planned to add website users export to DashaMail side along as hooks for Login extra.

About

DashaMail.ru MODX component

Resources

Stars

Watchers

Forks

0