Resources

Renesas IoT Sandbox Documentation

Email Library

These functions provide access to email services. Sending rate is limited to 20 per hour. Delivery will not be guaranteed for any sends beyond this rate. If you have your own Mandrill account, you can use the Mandrill Library instead and you won't have the limitation of 20 per hour.


Import


To use this library and its functions, you must use the import line at the beginning of your Base Python code.

import Email


Functions


Email.Email

Usage: Email.Email(sender='no-reply@mediumone.com', display_name='', recipients=None, subject='', message='', attachments=None)

The Email class represents an email object.

  • Credit cost: 0
  • Parameters:
    • sender: str email address of the sender (FROM attribute). Must be 'no-reply@mediumone.com'.
    • display_name: str name of the sender to be displayed by the mail client
    • recipients: str or [str] the recipient's email address. Also supports multiple email addresses separated by a semi-colon ';' or an array of strings.
    • subject: str the email subject line
    • message (optional): str message (will default to text email if set.
    • attachments (optional): Email.EmailAttachment object
  • Returns:
    • Email.Email



Email.EmailAttachment

Usage: Email.EmailAttachment(data, content_type, name)

The EmailAttachment class represents an email attachment object.

  • Credit cost: 0
  • Parameters:
    • data: str base64 encoded string of the data to attach
    • content_type: str MIME Content-Type of the data being attached (for example 'image/jpeg;')
    • name: str a name to associate to the attachment
  • Returns:
    • Email.EmailAttachment



Functions


Email.Email.text_message

Usage: Email.Email.text_message(message)

Set the email message content to send as text. This overrides any message set during Email object creation.

  • Credit cost: 0
  • Parameters:
    • message: str the message string.
      import Email
      email = Email.Email('no-reply@mediumone.com','my name','you@mail.com','message subject')
      email.text_message('from me to you... in text')
      email.send()
  • Returns: None



Email.Email.html_message

Usage: Email.Email.html_message(message)

Set the email message content to send as html. This overrides any message set during Email object creation.

  • Credit cost: 0
  • Parameters:
    • message: str the HTML formatted message string.
      import Email
      email = Email.Email('no-reply@mediumone.com','my name','you@mail.com','message subject')
      email.html_message('<!DOCTYPE html><html><title>Title</title><head></head><body><h2>From me to you,</h2><p> in HTML</p></body></html>')
      email.send()
  • Returns: None



Email.Email.sender

Usage: Email.Email.sender(sender)

Set the email of the sender. This overrides any sender's email set during Email object creation.

  • Credit cost: 0
  • Parameters:
    • sender: str the sender's email address.
      import Email
      email = Email.Email('no-reply@mediumone.com','my name','you@mail.com','message subject')
      email.sender('me2@mail.com')
      email.html_message('<!DOCTYPE html><html><title>Title</title><head></head><body><h2>From me to you,</h2><p> in HTML</p></body></html>')
      email.send()
  • Returns: None
Email.Email.display_name

Usage: Email.Email.display_name(display_name)

Set the email of the sender. This overrides any sender's email set during Email object creation.

  • Credit cost: 0
  • Parameters:
    • display_name: str the sender's display name.
      import Email
      email = Email.Email('no-reply@mediumone.com','my name','you@mail.com','message subject')
      email.display_name('my name too')
      email.html_message('<!DOCTYPE html><html><title>Title</title><head></head><body><h2>From me to you,</h2><p> in HTML</p></body></html>')
      email.send()
  • Returns: None



Email.Email.add_recipient

Usage: Email.Email.add_recipient(recipient)

Add a recipient's email to the list of recipients. This adds to the recipient's email list set during Email object creation.

  • Credit cost: 0
  • Parameters:
    • recipient: str a recipient's email address.
      import Email
      email = Email.Email('no-reply@mediumone.com','my name','you@mail.com','message subject')
      email.add_recipient('you2@mail.com')
      email.html_message('<!DOCTYPE html><html><title>Title</title><head></head><body><h2>From me to you,</h2><p> in HTML</p></body></html>')
      email.send()
  • Returns: None



Email.Email.add_attachment

Usage: Email.Email.add_attachment(attachment)

Add an attachment to the email. This adds to the attachment list.

  • Credit cost: 0
  • Parameters:
    • attachment: EmailAttachment object.
      import Email
      email = Email.Email('no-reply@mediumone.com','my name','you@mail.com','message subject')
      attachment = Email.EmailAttachment('iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==', 'image/png;', 'image of a red dot')
      email.html_message('<!DOCTYPE html><html><title>Title</title><head></head><body><h2>From me to you,</h2><p> in HTML</p></body></html>')
      email.add_attachment(attachment)
      email.send()
  • Returns: None



Email.Email.send

Usage: Email.Email.send()

Send the email message.

  • Credit cost: 1
  • Parameters: None
  • Returns: None

Getting Started
User Roles & Permissions
Streams, Tags, & Data Types
Dashboard Widgets
API
Workflow Studio
Workflow Libraries
Metering
Special Characters
Third Party Integration
Mobile
API Explorer

Email Library

These functions provide access to email services. Sending rate is limited to 20 per hour. Delivery will not be guaranteed for any sends beyond this rate. If you have your own Mandrill account, you can use the Mandrill Library instead and you won't have the limitation of 20 per hour.


Import


To use this library and its functions, you must use the import line at the beginning of your Base Python code.

import Email


Functions


Email.Email

Usage: Email.Email(sender='no-reply@mediumone.com', display_name='', recipients=None, subject='', message='', attachments=None)

The Email class represents an email object.

  • Credit cost: 0
  • Parameters:
    • sender: str email address of the sender (FROM attribute). Must be 'no-reply@mediumone.com'.
    • display_name: str name of the sender to be displayed by the mail client
    • recipients: str or [str] the recipient's email address. Also supports multiple email addresses separated by a semi-colon ';' or an array of strings.
    • subject: str the email subject line
    • message (optional): str message (will default to text email if set.
    • attachments (optional): Email.EmailAttachment object
  • Returns:
    • Email.Email



Email.EmailAttachment

Usage: Email.EmailAttachment(data, content_type, name)

The EmailAttachment class represents an email attachment object.

  • Credit cost: 0
  • Parameters:
    • data: str base64 encoded string of the data to attach
    • content_type: str MIME Content-Type of the data being attached (for example 'image/jpeg;')
    • name: str a name to associate to the attachment
  • Returns:
    • Email.EmailAttachment



Functions


Email.Email.text_message

Usage: Email.Email.text_message(message)

Set the email message content to send as text. This overrides any message set during Email object creation.

  • Credit cost: 0
  • Parameters:
    • message: str the message string.
      import Email
      email = Email.Email('no-reply@mediumone.com','my name','you@mail.com','message subject')
      email.text_message('from me to you... in text')
      email.send()
  • Returns: None



Email.Email.html_message

Usage: Email.Email.html_message(message)

Set the email message content to send as html. This overrides any message set during Email object creation.

  • Credit cost: 0
  • Parameters:
    • message: str the HTML formatted message string.
      import Email
      email = Email.Email('no-reply@mediumone.com','my name','you@mail.com','message subject')
      email.html_message('<!DOCTYPE html><html><title>Title</title><head></head><body><h2>From me to you,</h2><p> in HTML</p></body></html>')
      email.send()
  • Returns: None



Email.Email.sender

Usage: Email.Email.sender(sender)

Set the email of the sender. This overrides any sender's email set during Email object creation.

  • Credit cost: 0
  • Parameters:
    • sender: str the sender's email address.
      import Email
      email = Email.Email('no-reply@mediumone.com','my name','you@mail.com','message subject')
      email.sender('me2@mail.com')
      email.html_message('<!DOCTYPE html><html><title>Title</title><head></head><body><h2>From me to you,</h2><p> in HTML</p></body></html>')
      email.send()
  • Returns: None
Email.Email.display_name

Usage: Email.Email.display_name(display_name)

Set the email of the sender. This overrides any sender's email set during Email object creation.

  • Credit cost: 0
  • Parameters:
    • display_name: str the sender's display name.
      import Email
      email = Email.Email('no-reply@mediumone.com','my name','you@mail.com','message subject')
      email.display_name('my name too')
      email.html_message('<!DOCTYPE html><html><title>Title</title><head></head><body><h2>From me to you,</h2><p> in HTML</p></body></html>')
      email.send()
  • Returns: None



Email.Email.add_recipient

Usage: Email.Email.add_recipient(recipient)

Add a recipient's email to the list of recipients. This adds to the recipient's email list set during Email object creation.

  • Credit cost: 0
  • Parameters:
    • recipient: str a recipient's email address.
      import Email
      email = Email.Email('no-reply@mediumone.com','my name','you@mail.com','message subject')
      email.add_recipient('you2@mail.com')
      email.html_message('<!DOCTYPE html><html><title>Title</title><head></head><body><h2>From me to you,</h2><p> in HTML</p></body></html>')
      email.send()
  • Returns: None



Email.Email.add_attachment

Usage: Email.Email.add_attachment(attachment)

Add an attachment to the email. This adds to the attachment list.

  • Credit cost: 0
  • Parameters:
    • attachment: EmailAttachment object.
      import Email
      email = Email.Email('no-reply@mediumone.com','my name','you@mail.com','message subject')
      attachment = Email.EmailAttachment('iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==', 'image/png;', 'image of a red dot')
      email.html_message('<!DOCTYPE html><html><title>Title</title><head></head><body><h2>From me to you,</h2><p> in HTML</p></body></html>')
      email.add_attachment(attachment)
      email.send()
  • Returns: None



Email.Email.send

Usage: Email.Email.send()

Send the email message.

  • Credit cost: 1
  • Parameters: None
  • Returns: None