Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

delete() missing from Mailgun.Lists #498

Open
EricMarcantonio opened this issue Aug 17, 2020 · 0 comments
Open

delete() missing from Mailgun.Lists #498

EricMarcantonio opened this issue Aug 17, 2020 · 0 comments

Comments

@EricMarcantonio
Copy link

EricMarcantonio commented Aug 17, 2020

According to the documentation, when I want to delete a user from a mailing list, I should do it like so:

var list = mailgun.lists(`members@${DOMAIN}`);
    list.members(req.params.email).delete(function (err:any, body: any) {

However, Typescript throws me an error, saying that the delete function doesn't exist. I can verify this below:

namespace lists {
        interface MemberCreateData {
            subscribed: boolean;
            address: string;
            name: string;
            vars?: object;
        }

        interface MemberAddMultipleData {
            members: Array<{
                name?: string;
                address: string;
                subscribed?: boolean;
            }>;
            upsert?: boolean;
        }

        interface MemberUpdateData {
            subscribed: boolean;
            name: string;
            vars?: object;
        }

        interface Members {
            create(data: MemberCreateData, callback?: (err: Error, data: any) => void): Promise<any>;

            add(data: MemberAddMultipleData, callback?: (err: Error, data: any) => void): Promise<any>;

            list(callback?: (err: Error, data: any) => void): Promise<any>;
        }

        interface Member {
            update(data: MemberUpdateData, callback?: (err: Error, data: any) => void): Promise<any>;
        }

There is no delete function present on the lists.Member. Did it move?

To be more specific the documentation specifies:

var DOMAIN = 'YOUR_DOMAIN_NAME';
var mailgun = require('mailgun-js')({ apiKey: "YOUR_API_KEY", domain: DOMAIN });

var list = mailgun.lists(`mylist@${DOMAIN}`);

list.members('[email protected]').delete(function (err, body) {
  console.log(body);
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant