Hello.
What would be the process to send form submissions as a new subscriber in Mailster?
Thank you!
Hello.
What would be the process to send form submissions as a new subscriber in Mailster?
Thank you!
Hey @sprod,
Regretfully, there is currently no way in Cornerstone Forms to send submissions as a new subscriber in Mailster. That would require, custom development which we do not provide.
If you’re interested in doing this yourself or have a developer, the the process involves creating a new Action element that maps your form inputs to the Mailster subscriber API.
Please just note that the following instruction is not tested. It is only theoretical. The purpose is to give ideas how to proceed. We will not support any issues that may arise from the use of the following instructions.
The most robust way to add this without modifying the core plugin is to add the following code to your child theme’s functions.php or a custom snippet plugin.
Mailster ActionYou need to use cs_form_action_register() to define the action. This requires three main parts:
Here is a starting point for a Mailster integration. This code uses the recommended mailster('subscribers')->add() method.
add_action('cs_forms_booted', function() {
// 1. Define the Action Configuration
cs_form_action_register('cornerstone-actions-mailster-subscribe', [
'title' => __('Mailster Subscribe', 'cornerstone'),
'icon' => 'email', // Or a custom SVG path
'values' => [
'email_field' => cs_value('', 'markup'),
'firstname' => cs_value('', 'markup'),
'lastname' => cs_value('', 'markup'),
'list_id' => cs_value('', 'markup'),
'status' => cs_value(1, 'markup:int'), // 1 = Subscribed, 0 = Pending
],
'builder' => function() {
return [
'control_nav' => [
'element' => __( 'Action', 'cornerstone' ),
'element:general' => __( 'General', 'cornerstone' ),
],
'controls' => [
[
'type' => 'group',
'group' => 'element:general',
'controls' => [
[ 'key' => 'email_field', 'type' => 'text', 'label' => __('Email Field Name', 'cornerstone'), 'options' => [ 'placeholder' => 'email' ] ],
[ 'key' => 'firstname', 'type' => 'text', 'label' => __('First Name', 'cornerstone') ],
[ 'key' => 'lastname', 'type' => 'text', 'label' => __('Last Name', 'cornerstone') ],
[ 'key' => 'list_id', 'type' => 'text', 'label' => __('List ID', 'cornerstone') ],
[
'key' => 'status',
'type' => 'select',
'label' => __('Status', 'cornerstone'),
'options' => [ 'choices' => [ ['value' => 1, 'label' => 'Subscribed'], ['value' => 0, 'label' => 'Pending'] ] ]
],
],
],
]
];
},
'render' => function($data) {
// Ensure Mailster is active
if ( ! function_exists( 'mailster' ) ) {
throw new \Exception('Mailster is not active.');
}
// Get the data from the submitted form inputs
$subscriber_data = [
'email' => $data['email_field'],
'firstname' => $data['firstname'],
'lastname' => $data['lastname'],
'status' => (int) $data['status'],
];
// Add the subscriber (overwrite: true)
$subscriber_id = mailster( 'subscribers' )->add( $subscriber_data, true );
if ( is_wp_error( $subscriber_id ) ) {
throw new \Exception( $subscriber_id->get_error_message() );
}
// Assign to list if ID is provided
if ( ! empty( $data['list_id'] ) ) {
mailster( 'subscribers' )->assign_lists( $subscriber_id, (int) $data['list_id'] );
}
return $subscriber_id;
}
]);
});
{{dc:form:input key="email"}} ) into the First Name, Last Name, and Email fields of the action.Hi @christian
Thank you for your detailed reply which I appreciate.
That’s a shame as I was really looking forward to using CS Forms as most of my client sites use Mailster.
I almost seems like it wouldn’t even take that much effort for you/ThemeCo to have this available in an upcoming update with the code you supplied.
Is there a chance for this compatibility in a near upcoming update?
I appreciate it very much.
Thank you!
Hi @christian
In addition to my other response; is it possible to connect with Close CRM (https://close.com/)?
Thanks!
Hello @sprod,
Regretfully, connecting to Close CRM is also not possible. If you are interested in having a custom integration built, please contact us here. Tell us more about the integration, and we can send over a quote.
Best Regards.
Hello @sprod,
Thank you for your suggestion—we’ve added it to our feature requests. It may be prioritized based on internal voting and feedback from other customers regarding Mailster integration.
We’d also be happy to assist with custom integrations for Cornerstone Forms. Please share your details here at your convenience, and we’ll promptly send you a personalized quotation.
Thanks
Yes, I think cross compatibility is important especially with something like Zapier to send data.
Thank you, I appreciate it!
This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.