Sending email to a delta-chat user group

**Delta Chat version: 1.48.3 **

Desired behavior

Sending email directly to a group from command line (linux) desktop.

  1. I was able to send an email from outlook/gmail to my namomodi9@nine.testrun.org address. It showed up. No issues.
  2. I have created a group called ‘epsilon-chat’ using delta chat android app.
  3. How can I send an email to namomodi9@nine.testrun.org that it shows up directly in the group ‘epsilon-chat’?
  4. Purpose: to broadcast messages from command line, to a group/class students.

if you want it to be encrypted I’d use a script that starts delta chat to send it, doing it manually is too complex as it could make problems when people are added or removed to the group.
(so basically a deltachat bot)

But for your purpose you could also use a mailing list or possibly even a simple email with BCC? when you only need the people to receive your broadcast unless that broadcast should go to the same group where people are chatting, or should be encrypted.

For the Bot you have 2 options:

  • A. have a bot running as demon accepting commands from a script that you can call via command line
  • B. start the bot in the script, but that has the disadvantage that you need to keep deltachat-core/the-bot running until the message is sent out and that is more work to implement, not to mention possible concurrency issues if you have multiple scripts trying to send messages at the same time.

So I would go for A if you can.
the mechanism could be a simple bot that you add to the group:

  • then you need a way to find out the chatID of that group on the bot
  • and add local http server that has one endpoint to send your message
  • your script can then use curl --data "my message to the group" -X POST http://localhost:<port of bot http server>/<chat-id> to send the message over the bot you created.
  • as a finishing touch you would then write a systemd (or similar) service to restart your bot-daemon process on machine-reboot and for the unliekly case that it crashes.

to get started you can copy paste an example in the language you are most familiar with from GitHub - deltachat-bot/echo: An echo bot in multiple languages to get you started and then adjust it to your needs, ask here if you need help or don’t understand something.

1 Like