Search code examples
pythonemailpushbullet

Pushbullet, push request successfully sent but no email arrives in inbox?


My code sends notifications but doesn't send emails. I receive the notifications in the Pushbullet extension in Google Chrome, but not in my email inbox. No errors (e.g. 404, 405 etc.) are returned.

I'm using Python3.

This is the data sent (email holds the email address I've passed to the function):

data_send = {
            "email": email,
            "type": "note",
            "title": "Title",
            "body": "Message"
        }

This is the request:

resp = requests.post('https://api.pushbullet.com/v2/pushes',
                             data=json.dumps(data_send),
                             headers={'Authorization': 'Bearer ' +
                                      self.ACCESS_TOKEN,
                                      'Content-Type': 'application/json'})

This is what I set up so if there's any errors it'll print it out on console:

if resp.status_code != 200:
            raise Exception('Something wrong')
        else:
            print(resp.text)

When I run it, I get this response (I've xx'd out any personal details and copied it here like this so because it's easier to see than in the code format):

{"active":true,"iden":"xxxxxx","created":xxxxxx,"modified":xxxxxx,"type":"note","dismissed":false,"direction":"self","sender_iden":"xxxxxx","sender_email":"xxxxxx","sender_email_normalized":"xxxxxx","sender_name":"xxxxxx","receiver_iden":"xxxxxx","receiver_email":"xxxxxxxx","receiver_email_normalized":"xxxxxx","title":"Title","body":"Message"}

Plus, I get the notification in my Pushbullet extension in Google Chrome. But the email still hasn't arrived in my email.

The Pushbullet API documentation says to set target as "email". Ways I have tried to implement this:

data_send = {
            "target": "email",
            "type": "note",
            "title": "Title",
            "body": "Message"
        }

and

data_send = {
            "target": {"email": email},
            "type": "note",
            "title": "Title",
            "body": "Message"
        }

and

data_send = {
            "type": "note",
            "title": "Title",
            "body": "Message"
        }
data_send["target"] = "email"

None of these work.

I understand there may be issues with sending emails to other email addresses because of spam, but sending an email to myself should work. And if it doesn't send an email to the specified email address, it is supposed to send an email to the email address associated with my account (the same email address).

Is it just meant to take a long time? It's been a few hours since the email was supposed to have been sent.

I have looked at other questions on SO and the most related ones seem to be this one and this one.

Both questions don't really help in this particular scenario as they have no mention about having no errors but email not being received.

Apologies if this is long, please let me know if this question is not appropriate/goes against guidelines.

Edit: I realised if the email was the same as the one associated with my account, it might only end up sending the notification and not the email since Pushbullet detects I have an account with that email. I have tried to make the email an email different to the one associated with my account. However, doing this still doesn't work.

Edit2: When I try to send an email to an external email, that email appears in the conversations list when I visit the Pushbullet website. When I go to settings > people, the email appears when I run my program. The email still doesn't arrive in their inbox.

TLDR: Is my code just not picking up an error I'm not seeing? Or does Pushbullet usually take more than a few hours to send emails?


Solution

  • Developer confirmed email has been disabled in a reddit post. The Pushbullet website links to this subreddit.

    https://www.reddit.com/r/PushBullet/comments/gs5jz9/api_sending_emails_not_working/