email-rules.json.example 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. {
  2. "rules": [
  3. {
  4. "name": "mention-notification",
  5. "event": "issue_comment",
  6. "condition": {
  7. "type": "mention",
  8. "value": "username"
  9. },
  10. "recipients": ["{{mentioned_user}}"],
  11. "subject": "You were mentioned in {{full_repo}}#{{issue_number}}",
  12. "body": "Hi @{{mentioned_user}},\n\nYou were mentioned in issue #{{issue_number}} - {{issue_title}}\n\nRepository: {{full_repo}}\nComment by: {{sender}}\n\nComment:\n{{comment_body}}\n\n---\nThis is an automated notification from the Gogs webhook server."
  13. },
  14. {
  15. "name": "push-to-main",
  16. "event": "push",
  17. "condition": {
  18. "type": "branch",
  19. "value": "main"
  20. },
  21. "recipients": ["dev-team@example.com"],
  22. "subject": "Push to {{full_repo}}/{{branch}} by {{sender}}",
  23. "body": "New push to {{full_repo}} branch {{branch}}\n\nPusher: {{sender}}\nCommit: {{commit}}\nMessage: {{commit_msg}}\n\n---\nThis is an automated notification from the Gogs webhook server."
  24. },
  25. {
  26. "name": "issue-assigned",
  27. "event": "issues",
  28. "condition": {
  29. "type": "action",
  30. "value": "assigned"
  31. },
  32. "recipients": ["{{assignee}}"],
  33. "subject": "Issue assigned: {{full_repo}}#{{issue_number}}",
  34. "body": "Hi,\n\nYou have been assigned to issue #{{issue_number}} - {{issue_title}}\n\nRepository: {{full_repo}}\nAssigned by: {{sender}}\n\n---\nThis is an automated notification from the Gogs webhook server."
  35. },
  36. {
  37. "name": "pr-opened",
  38. "event": "pull_request",
  39. "condition": {
  40. "type": "action",
  41. "value": "opened"
  42. },
  43. "recipients": ["dev-team@example.com"],
  44. "subject": "New PR: {{full_repo}}#{{pr_number}}",
  45. "body": "New pull request opened in {{full_repo}}\n\nPR #{{pr_number}}: {{issue_title}}\nAuthor: {{sender}}\n\n---\nThis is an automated notification from the Gogs webhook server."
  46. }
  47. ]
  48. }