Skip to content

[Feature Request] More fluent syntax for common use casesΒ #30

@bkuhl

Description

@bkuhl

I'm a new user of the SDK, but it looks like this snippet is the best way to determine if an email is currently subscribed or not:

$subscription = $this->mailerLite->subscribers()->find($user->email);
if (property_exists($subscription, 'error') && $subscription->error->code === 123) {
   
}

This isn't very readable, and I was only able to obtain the 123 error code through trial & error as I didn't come across it in the documentation. It'd be great if there was a class constant representing this error code or if a shorthand helper method could be added such as if ($this->mailerLite->subscribers()->isSubscribed($email) that either returned a bool or threw an exception on error (e.g. 404).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions