← Mailgun

Create Mailing List Member with Mailgun API

Pipedream makes it easy to connect APIs for Mailgun and 800+ other apps remarkably fast.

Trigger workflow on
HTTP requests, schedules and app events
Next, do this
Create Mailing List Member with the Mailgun API
No credit card required
Into to Pipedream
Watch us build a workflow
Watch us build a workflow
7 min
Watch now ➜
Trusted by 250,000+ developers from startups to Fortune 500 companies:
Trusted by 250,000+ developers from startups to Fortune 500 companies

Developers Pipedream

Getting Started

Create a workflow to Create Mailing List Member with the Mailgun API. When you configure and deploy the workflow, it will run on Pipedream's servers 24x7 for free.

  1. Configure the Create Mailing List Member action
    1. Connect your Mailgun account
    2. Select a Mailing List
    3. Configure Email Address
    4. Optional- Configure Name
    5. Optional- Configure Vars
    6. Select a Subscribed?
    7. Select a Update if exists?
    8. Configure Halt on error?
  2. Select a trigger to run your workflow on HTTP requests, schedules or app events
  3. Deploy the workflow
  4. Send a test event to validate your setup
  5. Turn on the trigger

Details

This is a pre-built, open source component from Pipedream's GitHub repo. The component is developed by Pipedream and the community, and verified and maintained by Pipedream.

To contribute an update to an existing component or create a new component, create a PR on GitHub. If you're new to Pipedream component development, you can start with quickstarts for trigger span and action development, and then review the component API reference.

Create Mailing List Member on Mailgun
Description:Add to an existing mailing list. [See the docs here](https://documentation.mailgun.com/en/latest/api-mailinglists.html#mailing-lists)
Version:0.0.2
Key:mailgun-create-mailinglist-member

Code

import mailgun from "../../mailgun.app.mjs";
import common from "../common.mjs";

export default {
  ...common,
  key: "mailgun-create-mailinglist-member",
  name: "Create Mailing List Member",
  description: "Add to an existing mailing list. [See the docs here](https://documentation.mailgun.com/en/latest/api-mailinglists.html#mailing-lists)",
  version: "0.0.2",
  type: "action",
  props: {
    mailgun,
    list: {
      propDefinition: [
        mailgun,
        "list",
      ],
    },
    address: {
      propDefinition: [
        mailgun,
        "emailString",
      ],
    },
    /* eslint-disable pipedream/default-value-required-for-optional-props */
    name: {
      propDefinition: [
        mailgun,
        "name",
      ],
      optional: true,
    },
    vars: {
      propDefinition: [
        mailgun,
        "vars",
      ],
      optional: true,
    },
    /* eslint-enable pipedream/default-value-required-for-optional-props */
    subscribed: {
      propDefinition: [
        mailgun,
        "subscribed",
      ],
      description: "If `no`, will add unsubscribed",
      default: "yes",
    },
    upsert: {
      propDefinition: [
        mailgun,
        "upsert",
      ],
    },
    ...common.props,
  },
  async run({ $ }) {
    const resp = await this.withErrorHandler(this.mailgun.createMailinglistMember, {
      address: this.address,
      name: this.name,
      subscribed: this.subscribed,
      upsert: this.upsert,
      vars: this.vars,
      list: this.list,
    });
    $.export("$summary", `Successfully added ${this.address} to list`);
    return resp;
  },
};

Configuration

This component may be configured based on the props defined in the component code. Pipedream automatically prompts for input values in the UI and CLI.
LabelPropTypeDescription
MailgunmailgunappThis component uses the Mailgun app.
Mailing ListliststringSelect a value from the drop down menu.
Email Addressaddressstring
Namenamestring
Varsvarsobject

Extra arbitrary list member data

Subscribed?subscribedstringSelect a value from the drop down menu:truefalse
Update if exists?upsertstringSelect a value from the drop down menu:yesno
Halt on error?haltOnErrorboolean

Authentication

Mailgun uses API keys for authentication. When you connect your Mailgun account, Pipedream securely stores the keys so you can easily authenticate to Mailgun APIs in both code and no-code steps.

Get your API Key in the Control Panel, specifically in Settings > API Keys. More info in docs.

If your Mailgun account resides in the EU, choose the EU option in the Region field. Otherwise, choose the US (non-EU) region.

About Mailgun

Sending, receiving and tracking email effortlessly