Ansible is providing many types of modules for the automation process, this post let starts with sends an email to the developers or others once the application is deployed to the different environments. Will use mail module and it is useful for sending emails from playbooks.
Note: Refer the link to install Ansible:

- hosts: localhost
  become: yes
  become_user: USER_NAME
  gather_facts: false
  connection: local
    new_line: "\n"

##>> Sending email to team
- mail:
    port: 25
    subject: [$ENV] Deployment status of $SERVICE service
    body: Hi Team, {{new_line}}{{new_line}}We have deployed $APP_NAME application to the $ENV environment. Please do the sanity test.{{new_line}}{{new_line}}Thank you!,{{new_line}}DevOps team.{{new_line}}
    to: TO_USER1 <>
    cc: TO_USER2 <>
    headers: '|X-Special="Reports"'
    charset: utf8
  delegate_to: localhost