Coder Social home page Coder Social logo

alert_sender's Introduction

Alert Sender app

The repository is created to send an alert (SMS, Email, etc.) in case of an event

Regarding the sent alert using SMS, we are using the Twilio service, which provides an initial credit to start the trial, with paid options available afterward. To use the service, the user needs to obtain credentials, such as the Account SID and Auth Token, from Twilio, as well as a dedicated Twilio phone number. In our app, the event that may trigger an alert is a simple example that prompts the user to send the alert. To install Twilio:

pip install twilio 

Email sender uses smtplib, which can be configured to apply the SMTP protocol on services like Gmail (smtplib.SMTP('smtp.gmail.com', 587)), Yahoo (smtplib.SMTP('smtp.mail.yahoo.com', 587)), and others. Unlike the previous Twilio SMS sender, this email service is free of charge as it doesn't require a third-party company like Twilio.

It should be noted that, on May 30, 2022, Google restricted access to Gmail using third-party apps like ours. Therefore, users need to create an app password, and 2-step verification should be enabled prior to that. Here is the link to create an app password, along with a video guide: Google Link

Lastly, instead of smtplib, other options like yagmail can be employed as well by:

pip install yagmail

NotifPy

NotifPy is an all-in-one Python package designed to enable users to effortlessly send email and SMS notifications or alerts to designated email addresses and phone numbers. With NotifPy, integrating robust email and SMS functionalities into applications becomes seamless, facilitating prompt communication with target audiences.

Start Using NotifPy by

pip install NotifPy

To employ email services follow the below steps:

from NotifPy import EmailNotif
sender = EmailNotif.email_notif(sender_address='[email protected]', sender_password='your_email_password', recipient_email='[email protected]')
sender.EmailSender(subject = "It's me! Hi!", body='This is a test')

It is noteworthy, the default email service provider of package is gmail while simply it can be configured to yahoo, outlook/hotmail and the customized mode:

sender.EmailSender(subject = "It's me! Hi!", body='This is a test', email_provider='yahoo')
sender.EmailSender(subject = "It's me! Hi!", body='This is a test', email_provider='outlook')

For customized mode, it can be set based on SMTP server and port of your choice. For instance, for AOL mail:

sender.EmailSender(subject = "It's me! Hi!", body='This is a test', email_provider='', custom_server='smtp.aol.com', custom_port=587)

Furthermore, to use gmail service, due to recent Google policy, you need to first activate 2-step verfication then generate a 16-character app password for your email and use that password here. Google App Password

For SMS Notification, the current package version support Twillio service where based on account credentials the user is authenticated in our package. It should be noted, free trial is available in Twillio. Twillio Link

To utilize SMS service please follow below steps:

from NotifPy import SMSNotif
sender = SMSNotif.SMS_notif(body = "it's me Hi", recipient_phone_number= '+1...')
sender.twillio(account_sid="your account_sid from Twillio", auth_token="your auth_token from Twillio", twilio_phone_number="your number from Twillio")

alert_sender's People

Contributors

arianfotouhi avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.