Gmail

Get the number of unread email and their subjects from a gmail account

Neuron documentation

Video

Synapse

            
- name: "check-email"
  signals:
    - order: "est-ce que j'ai des emails?"
    - order: "quels sont mes emails?"
  neurons:
    - gmail_checker:
        username: "{{gmail_login}}"
        password: "{{gmil_password}}"
        file_template: "templates/gmail.j2"

        

Template

            
{% if unread|int() == 0 %}
Vous n'avez pas d'email
{% else %}
Vous avez {{ unread }} d'email
{% set count = 1 %}
{% for subject in subjects %}
     email {{ count }}. {{ subject }}
     {% set count = count + 1 %}
    {% endfor %}
{% endif %}