From 07cc5c0aa0c754394c9035fbf874f309fb0afab3 Mon Sep 17 00:00:00 2001 From: Shamzic Date: Fri, 10 Nov 2023 20:21:01 +0100 Subject: [PATCH] feat: ajoute le cron pour l'envoi du sondage initial par sms + refacto l'outil d'envoi d'email --- roles/bootstrap/tasks/setup_cron.yaml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/roles/bootstrap/tasks/setup_cron.yaml b/roles/bootstrap/tasks/setup_cron.yaml index a9804ed..0664dac 100644 --- a/roles/bootstrap/tasks/setup_cron.yaml +++ b/roles/bootstrap/tasks/setup_cron.yaml @@ -18,8 +18,19 @@ job: >- (cd {{ repository_folder }} && {{ envvar_prefix }} /usr/bin/node - ./dist-server/backend/lib/email.js send initial-survey + ./dist-server/backend/lib/email-sending-tool.js send initial-survey --multiple 1000 >> /var/log/{{ server_user_name }}/{{ item.name }}_emails.log 2>&1) +- name: Add a cron job to send initial survey by sms + become_user: "{{ server_user_name }}" + ansible.builtin.cron: + name: send initial survey sms for {{ item.name }} + minute: "8" + hour: "4" + job: >- + (cd {{ repository_folder }} && + {{ envvar_prefix }} /usr/bin/node + ./dist-server/backend/lib/sms-sending-tool.js send initial-survey + --multiple 1000 >> /var/log/{{ server_user_name }}/{{ item.name }}_sms.log 2>&1) - name: Add a cron job to send email become_user: "{{ server_user_name }}" ansible.builtin.cron: