N
Novu•10mo ago
Sapar

Not getting email notifications from topic

I use novu in my laravel app. I configured api key and uri. I created a topic: $novu->createTopic([ 'key' => 'seller_registration_notification', 'name' => $name, ]); The result is successful. [2024-02-09 10:16:23] local.INFO: [NovuService][Success]:createTopic {"id":"65c5fb765de7c63123a6da72","key":"seller_registration_notification"}
I created subscriber: $novu->createSubscriber([ 'subscriberId' => 'admin_20', 'email' => '[email protected]', 'firstName' => 'Sapar', 'lastName' => 'Atayev' ]); The result was successful. [2024-02-12 14:21:58] local.INFO: [NovuService][Success]:createSubscriber {"id":"65ca2988619fe4f9cf65013a","subscriberId":"admin_20","firstName":"Sapar","lastName":"Atayev","email":"[email protected]","channels":[],"organizationId":"6409c0dbe5d10c2178942df2","environmentId":"6409c0dbe5d10c2178942e1c","deleted":false,"createdAt":"2024-02-12T14:22:00.538Z","updatedAt":"2024-02-12T14:22:00.538Z","v":0} Added subscriber to topic: $novu->topic('seller_registration_notification')->addSubscribers(['admin_20']); Result is successful. [2024-02-12 14:21:59] local.INFO: [NovuService][Success]:addSubscribersToTopic {"succeeded":["admin_20"]} Created workflow manually through interface. Workflow ID is 'lpb-new-seller'. I added the step 'Email' in order to send email notification. Configured the email template in workflow. Sent notification to topic: $novu->triggerEvent([ 'name' => 'lpb-new-seller', 'to' => [ [ 'type' => 'Topic', 'topicKey' => 'seller_registration_notification' ], ], 'payload' => [ 'info' => 'info', 'name' => 'Mr. John', ] ]) Success. Novu activity feed shows success. But I don't receive any email to subscriber mail box. [2024-02-13 07:44:32] local.INFO: [NovuService][Success]:sendNotificationToTopics {"transactionId":"70544a21-28a8-49b1-9ce5-11bb7468627b","acknowledged":true,"status":"processed"} Need help. Thanks.
33 Replies
Pawan Jain
Pawan Jain•10mo ago
Can you try with small "topic"
Sapar
SaparOP•10mo ago
what do you mean "small"?
Pawan Jain
Pawan Jain•10mo ago
Change Topic with topic 'type' => 'topic'
Sapar
SaparOP•10mo ago
@Pawan Jain it didn't help {"transactionId":"948a7dcf-77a5-4909-9d16-77db6f04dc3f","acknowledged":true,"status":"processed"}
Pawan Jain
Pawan Jain•10mo ago
@Sapar let me check the logs Thanks for sharing the transactionId @Sapar In logs, I see this error
subscriberId under property to is not configured, please make sure all subscribers contains subscriberId property
subscriberId under property to is not configured, please make sure all subscribers contains subscriberId property
@unicodeveloper can you please with correct payload to trigger to a topic
Sapar
SaparOP•10mo ago
@Pawan Jain Iam a little bit confused. according to the documentation // Send notifications to a topic (all frontend users) $novu->triggerEvent([ 'name' => 'first-email', 'to' => [ [ 'type' => 'Topic', 'topicKey' => 'frontend-users' ] ] ])->toArray(); it has nothing to do with subscriberId here in trigger
Novu_Bot
Novu_Bot•10mo ago
@Sapar, you just advanced to level 1!
Prosper
Prosper•10mo ago
This is correct How many subscribers are added to your topic? @Sapar
Sapar
SaparOP•10mo ago
@unicodeveloper I added two subscribers to topic Can anyone help me?
Prosper
Prosper•10mo ago
I am checking this today to see what might be wrong. One question for you. When you were creating the subscribers, are you sure you added the id property? or was it email you added?
Sapar
SaparOP•10mo ago
I add an array of ids $novu->topic($topicKey)->addSubscribers(['admin_19', 'admin_20']);
Sapar
SaparOP•10mo ago
No description
Sapar
SaparOP•10mo ago
when I create subscribers: $novu->createSubscriber([ 'subscriberId' => config('novu.novu_admin_subscriberprefix') . '' . $user->id, 'email' => $user->email, 'firstName' => $user->first_name, 'lastName' => $user->last_name ]); when I create subscribers, I add subscriberId and email too @unicodeveloper
Prosper
Prosper•10mo ago
can you check the list of subscribers to be sure it returns both subscriberId and email? @Sapar
Sapar
SaparOP•10mo ago
@unicodeveloper yes, sure, here is the api response { "_id": "65c9f3f3b637cdb23e529aac", "_organizationId": "6409c0dbe5d10c2178942df2", "_environmentId": "6409c0dbe5d10c2178942e1c", "firstName": "Sopa", "lastName": "Atayev", "subscriberId": "admin_19", "email": "[email protected]", "channels": [], "deleted": false, "createdAt": "2024-02-12T10:33:23.407Z", "updatedAt": "2024-02-14T07:21:54.917Z", "v": 0 }, { "_id": "65ca2988619fe4f9cf65013a", "_organizationId": "6409c0dbe5d10c2178942df2", "_environmentId": "6409c0dbe5d10c2178942e1c", "firstName": "Sapar", "lastName": "Atayev", "subscriberId": "admin_20", "email": "[email protected]", "channels": [], "deleted": false, "createdAt": "2024-02-12T14:22:00.538Z", "updatedAt": "2024-02-14T07:21:54.927Z", "v": 0 }
Prosper
Prosper•10mo ago
@Sapar I just tested it on my end and it works as intended. So this is really strange 🤔
Sapar
SaparOP•10mo ago
and?
Prosper
Prosper•10mo ago
I want you to do me a favor and try with only number ids. e.g 445 or 88888. I want to verify something
Novu_Bot
Novu_Bot•10mo ago
@Sapar, you just advanced to level 2!
Sapar
SaparOP•10mo ago
@Prosper do you mean 445 instead of "admin_20"?
Prosper
Prosper•10mo ago
yes I mean this should not affect it but we want to rule out all options. Does your activity feed give you any error for the transactions?
Pawan Jain
Pawan Jain•10mo ago
@Sapar I see you have these subscribers admin_19 and admin_20 having different emails Could you check if emails are going to spam folder?
Sapar
SaparOP•10mo ago
@unicodeveloper yes, ok, I'm working on it, I'll add subscribers with numeric ids and I;ll let you know @Pawan Jain sure I checked spam folders, there are no messages in both mail boxes @unicodeveloper @Pawan Jain I created subscriber with Id 3775, created new topic, add him to topic, and sent notification to topic. {"transactionId":"8f074595-fdaa-47e9-b765-62b05286cf50","acknowledged":true,"status":"processed"}
Pawan Jain
Pawan Jain•10mo ago
I see there is only one subscriber in the topic and email is sent from our side
Sapar
SaparOP•10mo ago
@unicodeveloper @Pawan Jain activity feed has new item: transaction Id: 8f074595-fdaa-47e9-b765-62b05286cf50
No description
Sapar
SaparOP•10mo ago
@Pawan Jain yes, I added only one subsciber, did everything from scratch, shared response from api, and from activity feed
Prosper
Prosper•10mo ago
did you receive the email?
Sapar
SaparOP•10mo ago
@unicodeveloper no
Prosper
Prosper•10mo ago
@Pawan Jain confirmed that the email was sent from our end. What email provider are you using?
Sapar
SaparOP•10mo ago
@unicodeveloper { "providerId": "novu-email", "identifier": "novu-email-G-sfycO38C", "name": "Novu Email", "_environmentId": "6409c0dbe5d10c2178942e1c", "_id": "64da408c88468b9fd36f56e0" }
Sapar
SaparOP•10mo ago
@unicodeveloper @Pawan Jain I sent an email notification simply - to a subscriber, in this case I didn't get a message too { "data": { "acknowledged": true, "status": "processed", "transactionId": "9fa32c68-f444-4b23-8720-98844fc81f1b" } }
No description
Sapar
SaparOP•10mo ago
Even though the activity feed shows SUCCESS
No description
Sapar
SaparOP•10mo ago
any ideas with that? @unicodeveloper @Pawan Jain I regenerated API key and repeated sending email message to subscriber, as a result got error: { "message": "Bad Request", "code": 400, "response": { "headers": { "server": "nginx", "date": "Wed, 14 Feb 2024 12:55:25 GMT", "content-type": "application/json", "content-length": "204", "connection": "keep-alive", "access-control-allow-origin": "https://sendgrid.api-docs.io", "access-control-allow-methods": "POST", "access-control-allow-headers": "Authorization, Content-Type, On-behalf-of, x-sg-elas-acl", "access-control-max-age": "600", "x-no-cors-reason": "https://sendgrid.com/docs/Classroom/Basics/API/cors.html", "strict-transport-security": "max-age=600; includeSubDomains" }, "body": { "errors": [ { "message": "Does not contain a valid address.", "field": "personalizations.0.to.0.email", "help": "http://sendgrid.com/docs/API_Reference/Web_API_v3/Mail/errors.html#message.personalizations.to" } ] } } } { "providerId": "novu-email", "identifier": "novu-email-G-sfycO38C", "name": "Novu Email", "_environmentId": "6409c0dbe5d10c2178942e1c", "_id": "64da408c88468b9fd36f56e0" } transactionId: 21fd96aa-b36b-41f2-b185-033f17473623
Want results from more Discord servers?
Add your server