Replies: 1 comment
-
Thanks for the request. We eventually plan to move subscriptions out of core Craft Commerce and let them live in payment provider plugins like our new Stripe plugin. In the meantime you might be able to just do something like this in a module: Event::on(
Subscriptions::class,
Subscriptions::EVENT_AFTER_CREATE_SUBSCRIPTION,
function(SubscriptionEvent $event) {
$mailer = Craft::$app->getMailer();
/** @var Message $newEmail */
$newEmail = Craft::createObject(['class' => $mailer->messageClass, 'mailer' => $mailer]);
$newEmail->setTo($event->subscription->getSubscriber()->email);
$newEmail->setSubject('Your new subscription');
$newEmail->setHtmlBody('You have a new subscription');
Craft::$app->getMailer()->send($newEmail)
}
); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Description
I would like to send an email confirmation when a user do a subscription.
I see in the doc how to do it with orders on products, but no informations about email on subscriptions...
Any ideas ?
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions