Commit a2def7ee authored by michael's avatar michael

24: Add list of commits to publication notification mail

parent 0c6c818d
......@@ -98,6 +98,7 @@ class PublishController extends Controller {
* all addresses set in the book's yaml configuration
*/
$extraRecipients = $this->get('github.hook.processor')->recipients;
$commits = $this->get('github.hook.processor')->commits;
$library = $this->get('library');
$messages = $this->get('publisher')->getMessages();
$parts = $library::parseIdentifier($identifier);
......@@ -111,8 +112,9 @@ class PublishController extends Controller {
$renderParams = [
'publishURLBase' => $webPath,
'status' => $subject,
'messages' => $messages,
'status' => $subject,
'messages' => $messages,
'commits' => $commits,
];
$body = $this->renderView('AppBundle:Emails:notify.html.twig', $renderParams);
$mail = \Swift_Message::newInstance()
......
<p><strong>Note from
<a href="{{ publishURLBase }}">{{ publishURLBase }}</a>:<br />
{{ status }}</strong>
<p>
<strong>
Note from <a href="{{ publishURLBase }}">{{ publishURLBase }}</a>:
<br/>
{{ status }}
</strong>
</p>
<p>Please check the publish log for any errors:</p>
<h4>Messages:</h4>
<ul>
{% for message in messages %}
<li><strong>{{ message.label }}:</strong> {{ message.content|raw }}</li>
{% endfor %}
</ul>
<p>You are receiving this message because either (a) you have made commits
included in the changes currently being published, or (b) your email address
is set for notification in this book's repository.</p>
<p>If you have questions, please contact the CiviCRM documentation working
group here:<br />
<h4>Commits:</h4>
<ul>
{% for commit in commits %}
<li>
<strong><a href="{{ commit.url }}">{{ commit.id }}</a></strong> |
{{ commit.message }} | {{ commit.author.username }}
</li>
{% endfor %}
</ul>
<p>
You are receiving this message because either (a) you have made commits
included in the changes currently being published, or (b) your email address
is set for notification in this book's repository.
</p>
<p>If you have questions, please contact the CiviCRM documentation working group
here:
<br/>
<a href='https://chat.civicrm.org/civicrm/channels/documentation'>
https://chat.civicrm.org/civicrm/channels/documentation</a></p>
https://chat.civicrm.org/civicrm/channels/documentation
</a>
</p>
......@@ -7,7 +7,12 @@ class GitHubHookProcessor {
/**
* @var array of strings for email addresses of people to notify
*/
public $recipients = array();
public $recipients = [];
/**
* @var array
*/
public $commits = [];
/**
* @var string the URL for the repository
......@@ -73,6 +78,8 @@ class GitHubHookProcessor {
$this->addRecipients($commit->author->email);
$this->addRecipients($commit->committer->email);
}
$this->commits = $payload->commits;
}
/**
......@@ -91,5 +98,4 @@ class GitHubHookProcessor {
$this->recipients = array_unique(array_merge($this->recipients, $recipients));
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment