Skip to main content

A mailer designed to be used by robots to send process reports

Project description

Riverit RPA mailer

PyPI version
Email notification library for Robocorp robots to use for reporting their process.
Mailer will send an email to the selected address, with the option of having a list of links to the handled files.

Setup

To get the RPA mailer up and running, provide with the following configuration details:

Robot_Mailer

Your Microsoft graph details:

Provide the Robot_mailer with a dictionary of account details.

  • CLIENT_ID = ["clientid"] :Your Microsoft Graph Client ID
  • TENANT_ID = ["tenantid"] :Your Microsoft Graph Tenant ID
  • USERNAME = ["username"] :Email address of the sending account
  • PASSWORD = ["password"] :Password for the sending account

Email sender (optional)

Provide the address to act as the from: in the emails.
You need to have permissions to send as or send on behalf of that mailbox.
If not provided, email will be sent from the username address.

Send_report_mail()

Recipients

A list of adresses to send the report to

process name

A string name for the process being reported on

status

The status of the process run.
0 = failure
1 = attention
2 = success

message

(Optional) a string message to provide additional info.

files handled

(Optional) a list of files handled by the process run. Items on the list will be emailed as html link elements.

Requirements

python >= 3.10 msal >= 1.31.0

Example Usage

from riverit_rpa_mailer import Robot_Mailer


mailer_secrets = {
    'CLIENT_ID': 'your_client_id',
    'TENANT_ID': 'your_tenant_id',
    'USERNAME': 'your_email@example.com',
    'PASSWORD': 'your_password'
}
sender_address = 'another_email@example.com'

# Initialize the mailer

mailer = Robot_Mailer(mailer_secrets, sender_Address)


# Define recipients and report details
recipients = ['recipient1@example.com', 'recipient2@example.com']
process_name = 'Data Processing'
status = 2  # Success
handled_files = ['file1.csv', 'file2.csv']

message = "Notes"

# Send the email report
mailer.send_report_mail(recipients, process_name, status, files_handled = handled_files, optional_message = message)

Developing the package

Publishing

The CI pipeline will handle the building and publishing of the package once a pull request is submitted.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

riverit_rpa_mailer-1.1.1.tar.gz (9.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

riverit_rpa_mailer-1.1.1-py3-none-any.whl (13.5 kB view details)

Uploaded Python 3

File details

Details for the file riverit_rpa_mailer-1.1.1.tar.gz.

File metadata

  • Download URL: riverit_rpa_mailer-1.1.1.tar.gz
  • Upload date:
  • Size: 9.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for riverit_rpa_mailer-1.1.1.tar.gz
Algorithm Hash digest
SHA256 a9cb78bcac60793828d518a62b862de93fcd1776e8094b204a6e18e37e055663
MD5 f4214ec394a351317cb52d53cee80197
BLAKE2b-256 6e42a7e13bcb52fb7fa179a1a71d222bf7d43ac7f962769a1bb638034b7efaed

See more details on using hashes here.

File details

Details for the file riverit_rpa_mailer-1.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for riverit_rpa_mailer-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d3b2dacada39d6fe7bcf36c6166257ad9907baf19c70acea3986e9dffbf199d9
MD5 a4b05c185c541b878eaff1e696057971
BLAKE2b-256 a5f08e1ef6b30370374275c8c6d1b46b8058ecd37dc6030285a9729b2127b7bf

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page