Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Fix up git URLs
run: echo -e '[url "https://github.com/"]\n insteadOf = "git://github.com/"' >> ~/.gitconfig

- name: environment
run: |
echo "GITHUB_WORKSPACE=${GITHUB_WORKSPACE}"
Expand All @@ -58,7 +61,7 @@ jobs:

- name: docker-compose install
run: |
curl -L https://github.com/docker/compose/releases/download/1.11.2/docker-compose-`uname -s`-`uname -m` > ~/docker-compose
curl -L https://github.com/docker/compose/releases/download/1.29.2/docker-compose-`uname -s`-`uname -m` > ~/docker-compose
chmod +x ~/docker-compose
sudo mv ~/docker-compose /usr/local/bin/docker-compose
docker-compose --version
Expand Down
16 changes: 11 additions & 5 deletions Model/Behavior/MailQueueBehavior.php
Original file line number Diff line number Diff line change
Expand Up @@ -529,10 +529,12 @@ private function __getSettingPluginKey(Model $model) {
* @param Model $model モデル
* @param array $sendTimes メール送信日時 配列
* @param string $typeKey メールの種類
* @param string $sendRoomPermission 送信するルームの役割。ルームでないときは無視される
* @return void
*/
public function saveQueue(Model $model, $sendTimes = null,
$typeKey = MailSettingFixedPhrase::DEFAULT_TYPE) {
$typeKey = MailSettingFixedPhrase::DEFAULT_TYPE,
$sendRoomPermission = null) {
$model->Behaviors->load('Mails.IsMailSend', $this->settings[$model->alias]);

$languageId = Current::read('Language.id');
Expand Down Expand Up @@ -568,7 +570,7 @@ public function saveQueue(Model $model, $sendTimes = null,

// 投稿メール - ルーム配信
$this->saveQueuePostMail($model, $languageId, $sendTimes, $userIds, $toAddresses,
$roomId, $typeKey);
$roomId, $typeKey, $sendRoomPermission);

} else {
//$workflowType == self::MAIL_QUEUE_WORKFLOW_TYPE_NONE ||
Expand All @@ -580,7 +582,7 @@ public function saveQueue(Model $model, $sendTimes = null,

// メールキューSave
$this->saveQueuePostMail($model, $languageId, $sendTimes, $userIds, $toAddresses,
$roomId, $typeKey);
$roomId, $typeKey, $sendRoomPermission);
}
}

Expand All @@ -595,11 +597,13 @@ public function saveQueue(Model $model, $sendTimes = null,
* @param array $toAddresses 送信先メールアドレス 配列
* @param int $roomId ルームID
* @param string $typeKey メールの種類
* @param string $sendRoomPermission 送信するルームの役割。$roomIdとセットに使用する
* @return void
* @throws InternalErrorException
*/
public function saveQueuePostMail(Model $model, $languageId, $sendTimes = null, $userIds = null,
$toAddresses = null, $roomId = null, $typeKey = MailSettingFixedPhrase::DEFAULT_TYPE) {
$toAddresses = null, $roomId = null, $typeKey = MailSettingFixedPhrase::DEFAULT_TYPE,
$sendRoomPermission = null) {
$model->Behaviors->load('Mails.IsMailSend', $this->settings[$model->alias]);
if ($sendTimes === null) {
$sendTimes[] = $model->MailQueue->getSaveSendTime();
Expand Down Expand Up @@ -681,7 +685,9 @@ public function saveQueuePostMail(Model $model, $languageId, $sendTimes = null,

// ルーム配信で送るパーミッション
/** @see MailQueueUser::getSendRoomPermission() */
$sendRoomPermission = $model->MailQueueUser->getSendRoomPermission($typeKey);
if (! isset($sendRoomPermission)) {
$sendRoomPermission = $model->MailQueueUser->getSendRoomPermission($typeKey);
}

// ルーム配信
/** @see MailQueueUser::addMailQueueUserInRoom() */
Expand Down