Mandrill api log says message is sent, but I don't receive it, and it doesn't show in activity - mandrill

Using a production key on Mandrill I am attempting to send an email. Previously this has worked without issue. However now, despite receiving a successful response from the API, visible in the api log, no email is being sent, and nothing is present in the outbound activity log.
If I check the api log for the message which appeared to fail it displays:
[
{
"email": [email_address],
"status": "sent",
"_id": [id],
"reject_reason": null
}
]
Replacing the id in the content view of a sent email, with the id from a failed one displays a correctly formatted email:
e.g. https://mandrillapp.com/activity/content?id=20151214_[put_the_id_here]
Is this a bug? What is causing it? Where can I see more information about what happened? How can I monitor if this happens again in the future? How can I prevent it from happening in the future?

I have been in contact with Mandrill support regarding the issue, which they described as 'very strange indeed'. Deleting the API key and generating a new one fixed the issue, but there is no explanation as to why this is they case, how to detect the problem, or how to stop it from happening again in the future.
The messages in question were never actually sent by Mandrill, and displayed no SMTP events, despite reporting as sent by their API

Something else to check is to make sure you're using a working API key instead of a test one. As the name suggests, test keys are designed to work just like a regular key, so the feedback to your program will be identical, but the messages won't actually be sent.
You can see if this is the problem by going to the Mandrill settings and looking at the list of API keys. Test keys have a very clear This is a test key message listed.
This probably won't be an issue if you generated the key yourself, but if you inherited this project it's worth taking a look.

I have faced a similar issue like this last week. The "sent" status only indicates that Mandrill sent it. But reception of the email message is confirmed only if there is a SMTP event corresponding to it with code starting with 2, (example 250 etc), in the info api response, like the following:
"smtp_events": [
{
"ts": 1442448422,
"type": "sent",
"diag": "250 SmtpThread-4622542-14682902148#ps-they-19.uk.miplecast.lan Received OK",
"source_ip": "505.207.171.171",
"destination_ip": "705.139.255.221",
"size": 29501
}
check this link for more info.
https://mandrill.zendesk.com/hc/en-us/articles/205582697-How-to-Confirm-If-an-Email-Was-Actually-Delivered
the issue could be on the recipient server as well, due which delivery could be delayed. In our experience last week, the message was delivered 4 hours after being Sent. we were not able to establish the reason yet why, this delay happened.
HTH,

Related

Does google workspace marketplace give any kind of notification of installation?

When someone installs my application to their google workspace, does google send any kind of notification to my infrastructure - say via webhook?
Or am I responsible for the onboarding/first-run experience on my own, either via polling or upon the first time a user visits my application?
To my knowledge, Google doesn't notify you directly anywhere. To do this you have to use the licenseNotification.list API. With this you can get a list of installs/uninstalls of your app along with the user emails. A sample response would look like this:
{
"kind": "appsmarket#licenseNotification",
"id": <some-notification-id>,
"applicationId": <your-app-id>,
"customerId": "email#example.com",
"timestamp": <unix-timestamp>,
"provisions": [
{
"kind": "appsmarket#provisionNotification",
"editionId": "default_edition",
"seatCount": "1"
}
]
}
As you can see, it contains the email of the user and whether or not it was provisioned. It also returns a nextPageToken with the last notification id, so you can store it and send it in your next request as startToken and get results after the last notification you got. With this in mind, you could build some kind of Pub/Sub service to poll the API periodically and notify your app when you get new provisioned users.
Reference:
licenseNotification.list

Not all subscribed iOS devices to topic receive data notification, most often none at all. Notification without data works as expected

My app is implemented in React Native and is using Firebase for notifications. We have webhooks on the web app that are triggered on certain events. Those webhooks then send a request to the respective Firebase Cloud Function. With information from the request's header they get the topic they must send the notification to; from the request's body it gathers the information to be sent as data to the device. They are sent as data notifications only, the handler (using the React Native FCM API) then shows a local notification already translated with i18n using the react-native-push-notifications package. Everything works fine until I hit the weird situation described below.
Everything was doing alright both on Android and iOS until I launched the app on Test Flight for internal testing and then it stopped working after some time on iOS. Eventually, I noticed that when more than one iPhone subscribed to the same topic it eventually lead to inconsistencies in the delivery of the data notifications. The first iPhone to subscribe to the topic usually worked, the others didn't, the first one most of the time eventually stopped working as well or sometimes it just kept working while the others still didn't. I used the Firebase Console to send some test notification to the subscribed devices and it they actually received it. I then changed my Cloud Functions' code to avoid sending any data and just send some example body and title and it turns out the problem was here. As soon as I send something through the data field in the admin.messaging.Message object to be sent as argument to the admin.messaging().send method, they aren't received by the iPhone devices subscribed to the topic (or it's received by one or two max, the first ones to currently subscribe to the topic. But they usually stop receiving them after a while as well).
This is really really weird and being so inconsistent makes it practically impossible to debug with my current knowledge. Some things to keep in mind:
All Android devices still receive the notifications without a problem
I've watched the iPhone's console through Xcode to see if there was some error when processing the notification, in case they were actually getting the notification but they it failed before it was shown to the user. But nothing is logged by the SpringBoard process, making me conclude the notifications aren't actually getting to the device
I've manually sent notifications with cURL to APNs (with this guide). They were received fine
All notifications without data, regardless of the iOS specific apn headers, payload, etc, are received
What can be the cause of the problem? Or there's something in my code causing this strange behavior (which I doubt, since it works fine on Android and works fine in iOS as well on specific scenarios), there's some type of bug on Firebase's side causing some notifications to not be sent or, finally, there's some error on Apple's APNs side causing this. Highly doubt the last one, if the fault lays on any exterior factor it probably should be on Firebase's handling of topics.
Really would appreciate some help. Thanks in advance. Sorry If I didn't gave enough information, I actually never had the need to do a question on Stack Overflow. I'll leave below an example of a cloud function as well.
exports.orderPending = functions
.region("europe-west2")
.https.onRequest((req, res) => {
if (req.method == "POST") {
res.status("200").send("Webhook successful");
const topic = req.headers["code"];
const message = {
data: {
id: JSON.stringify(req.body.order.id),
event: "orderPending",
order: JSON.stringify(req.body.order),
},
topic,
android: {
priority: "high",
},
apns: {
payload: {
aps: {
contentAvailable: true,
},
},
headers: {
"apns-push-type": "background",
"apns-priority": "5",
"apns-topic": "APP BUNDLE ID HERE",
},
},
};
functions.logger.log(req.body.order.id);
functions.logger.log(topic);
admin.messaging().send(message)
.then((response) => {
console.log("Successfully sent message: ", response);
})
.catch((error) => {
console.log("Error sending message: ", error);
});
}
});
Turns out the data payload was exceeding the 4KB APNs limit but since when you send by topic it doesn't show any errors at all I had no way of knowing. So yeah, add this to your checklist

FCM custom sound not working on iOS when in background mode

Did something change with FCM recently? Our apps use custom sound in push notifications. This has been working fine on both Android and iOS, whether in foreground, background, or closed. But recently something seems to have changed as the same PHP code we've been using suddenly stopped working for custom sounds when the app is closed or in background mode? (The notification is delivered, but it just uses the default device sound).
I was able to get it working again on Android by just including the sound files in /app/src/res/raw (we used to keep them there, but for a long time now it wasn't needed yet always worked... apparently it's needed again). Ok Android solved.
But for iOS it still has stopped working! I'm not sure if it's something I'm doing wrong in xCode or if I need to change the PHP code used to trigger the notifications. So here's both to review:
I am using:
xCode 11.6
iOS target 11.0
Testing on real device, iOS 13.6.1
Sound files are at {Project Name}/Resources/ and were added with "Copy items if needed" and "Create groups" both checked
Server side code to trigger notifications (which always worked fine before and has not been changed):
{
"notification": {
"title": "Test Title",
"body": "Test Body",
"sound": "sound_file.mp3",
},
"registration_ids": ["APA...g","fl...CS"]
}
Please help... thought I was past all of this years ago...ugggg!
Detail information:
https://medium.com/#ThatJenPerson/authenticating-firebase-cloud-messaging-http-v1-api-requests-e9af3e0827b8
Sample code:
{
"message":{
"token":"ewrTK.....",
"notification":{
"title":"Breaking News",
"body":"New news story available."
},
"data":{
"title":"Notification title",
"body":"Notfication body"
},
"apns":{
"payload":{
"aps":{
"sound":"notification.mp3"
}
}
}
}
}
We just touched base with the Firebase dev team and they were able to reproduce the issue. They have just created an internal ticket to fix this. Will follow up here on the resolution progress
After several additional rounds communication with Firebase, here is the current status update and their response:
I would like to let you know that this issue was just recently
identified as a bug with our Legacy API that’s not properly handling
the custom sound for iOS. Our FCM gurus have identified the fix for
this issue, and the fix is about to be released on our production, but
we can’t share any exact details or timeline for the release. The fix
should let you send notifications properly based on your custom sounds
configuration and there should be no code changes needed on your end.
Also, it should still properly handle the notification sounds if the
app is closed or in background state for your iOS application.
We are furthermore told that for the moment, migration from FCM HTTP to HTTP v1 is the only work around. Will post here again once we hear confirmation on the fix to the Legacy API (which most people reading this as using). Stay tuned...
We created a ticket with Google/Firebase support.
Their answer:
There's no ongoing issue on our end that may cause the custom sound to not work. However, by specifying a custom sound, the sound file must be on the user's device already, either in the app's bundle or in the library/Sounds folder of the app's container. You can refer to this documentation for more information.
For FCM, there isn't any extra sound processing, only passing the payload field, so as long as the payload on the client shows "sound" file is successfully passed down, there may be an issue with the setup. If there's no recent change for your application and the sound files, then this may be something caused on Apple's end. With that, it's best to check this with them.
We discovered that we apparently use the legacy HTTP API so we tested the newer HTTP v1 version. (described here: https://firebase.google.com/docs/cloud-messaging/migrate-v1 )
This solved the problem for us. Custom sound is back.
In the mean time Firebase support replied the following and now acknowledges there is a problem with the legacy HTTP API.
Thanks for sharing your observations, Mark.
We’ve received similar reports regarding this issue and that indicates
that this is not an unusual issue in relation to the increasing
reports on the Stack Overflow discussion that you’ve mentioned too.
With that, this issue was just recently identified as a bug with our
Legacy API that’s not properly handling the custom sound for iOS. Our
engineering team has identified the fix for this issue, and we
couldn’t provide a definite timeline at the moment for the release in
our production. I’ll let you know once I have an update for this
issue.
For now, you might consider using our HTTP v1 API to send your
messages. Apologies for the inconvenience this may have caused you.
On my side, no matter what sound name I set, I always receive on ios side "sound": "default"
Sending:
{
"notification": {
"title": "Alert",
"body": "Test Message",
"sound": "alert.aiff",
},
"registration_ids": ["APA...g","fl...CS"]
}
Receiving:
{
aps = {
alert = {
body = "Test Message";
title = Alert;
};
"content-available" = 1;
sound = default;
};
}
The only reason for this to happen is that FCM set sound to default while it redirect to APNS. Need ask google
Please check guys, Google has fixed this issue !!

Sinch Client works but messages aren't being sent

I'm using sinch and I've gotten the client to work by registering a user, but I can't send a message. When I click my send button, nothing happens. The required methods that need to be implemented, such as messageFailed(), messageDelivered(), etc. are not being called either. Does anyone know why?
Have you registered the one more user? Can you enable logging and share the full log output.
See comment below, user tried to send message to self

Sending mail without leaving app

I want to send a simple mail from my app without leaving it and I already have the code from other questions in this forum, but my problem is that when I send an email from my app, I have to open the mail program from apple so the mail is being sent.
I get a MFMailComposeResultSent when I send the mail from my app but it stays in the memory or somewhere else until I open the apple-mail-app.
I noticed when searching for my mistake that I never let the user enter his email address and password but they're both saved in the apple-mail-program, that's what I think why I need to open the standard-app.
Any suggestions on how to solve my problem? Any help is appreciated.
You did nothing wrong if you are getting a MFMailComposeResultSent. This is not about any username or password of the email account. The documentation says about MFMailComposeResultSent: Send may only be interpreted as a successful queueing of the message for later sending. The actual send will occur when the device is able to send.
Also your problem became a possible duplicate of: ios4.3.4: MFMailComposer doesn't send an email, but return MFMailComposeResultSent status

Resources