Elementor Form Integration

Connect Elementor form submissions to SMS newsletter subscriptions.

Connect Elementor Pro form submissions directly to your WP SMS newsletter subscriber list.

Requirements

  • Elementor Pro installed and active
  • WP SMS plugin installed and active

Integration Code

Add this code to your theme’s functions.php or a custom plugin:

function subscribe_form_entry_to_sms_newsletter($record, $handler)
{
    $form_name = $record->get_form_settings('form_name');

    if ('MY_FORM_NAME' !== $form_name) {
        return;
    }

    $raw_fields = $record->get('fields');
    $fields = [];

    foreach ($raw_fields as $id => $field) {
        $fields[$id] = $field['value'];
    }

    \WP_SMS\Newsletter::addSubscriber(
        $fields['first_name'],
        $fields['mobile_number']
    );
}

add_action('elementor_pro/forms/new_record', 'subscribe_form_entry_to_sms_newsletter', 10, 2);

Configuration

  1. Replace 'MY_FORM_NAME' with your actual Elementor form name
  2. Update field IDs to match your form:
    • first_name - Name field ID
    • mobile_number - Phone field ID

How to Find Field IDs

  1. Edit your Elementor form
  2. Click on each field
  3. Find the ID setting in the Advanced tab

With Group Assignment

To add subscribers to a specific group:

\WP_SMS\Newsletter::addSubscriber(
    $fields['first_name'],
    $fields['mobile_number'],
    '2' // Replace with your Group ID
);

TIP

WP SMS offers a dedicated Elementor Form Add-on for integration without custom code. Check the Add-ons page.

Last updated: December 28, 2025