MCPcopy
hub / github.com/CryptoSignal/Crypto-Signal / notify

Method notify

app/notifiers/gmail_client.py:32–53  ·  view source on GitHub ↗

Sends the message. Args: message (str): The message to send. Returns: dict: A dictionary containing the result of the attempt to send the email.

(self, message)

Source from the content-addressed store, hash-verified

30
31 @retry(stop=stop_after_attempt(3))
32 def notify(self, message):
33 """Sends the message.
34
35 Args:
36 message (str): The message to send.
37
38 Returns:
39 dict: A dictionary containing the result of the attempt to send the email.
40 """
41
42 header = 'From: %s\n' % self.username
43 header += 'To: %s\n' % self.destination_addresses
44 header += 'Content-Type: text/plain\n'
45 header += 'Subject: Crypto-signal alert!\n\n'
46 message = header + message
47
48 smtp_handler = smtplib.SMTP(self.smtp_server)
49 smtp_handler.starttls()
50 smtp_handler.login(self.username, self.password)
51 result = smtp_handler.sendmail(self.username, self.destination_addresses, message)
52 smtp_handler.quit()
53 return result

Callers 7

notify_discordMethod · 0.45
notify_slackMethod · 0.45
notify_twilioMethod · 0.45
notify_gmailMethod · 0.45
notify_telegramMethod · 0.45
notify_webhookMethod · 0.45
notify_stdoutMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected