Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mailing command #120

Merged
merged 2 commits into from
Oct 5, 2022
Merged

Conversation

Isengo1989
Copy link
Contributor

@Isengo1989 Isengo1989 commented Oct 4, 2022

As talked about with @shyim in Slack here is a simple integration with email instead of webhooks.

The integration with the notifier component from symfony is nice as well, but uses the message queue to send messages. There is always the possibility of adding an own webhook interface, but probably just overkill atm (as well as adding an own mailtemplate/migration etc. to the mail integration).

Feel free to mention the other dev that you referred to.

Usage

3 configs are added

  • Mail
  • Grace time for queue (those are curerntly fixed in the code of the healthchecker)
  • Grace time for task (those are curerntly fixed in the code of the healthchecker)

First argument must be a Saleschannel ID

bin/console frosh:monitor 4606300361c34ae3b69d813bb292f823

Email can be overwritten in command:

bin/console frosh:monitor 4606300361c34ae3b69d813bb292f823 --email=michahobert@test.de

PS: Small fixes done by PHPCSFIXER

@@ -239,7 +238,7 @@ private function buildCoalesce(array $fields, Context $context): string
}
}

return substr($coalesce, 0, -1) . ')';
return mb_substr($coalesce, 0, -1) . ')';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PHPCSFIXER: .php-cs-fixer.dist.php

// Replace non multibyte-safe functions with corresponding mb function.
'mb_str_functions' => true,

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should disable that 😂

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I saw you used it in other classes as well, keep it similar I would say. Only diff is apperently that it will handle UTF-8 encoding better. You can disable it in the php-cs-fixer file tho, i am emotionless in that topic 😆

@Isengo1989
Copy link
Contributor Author

@shyim what is missing here? Should I revert the mb_substr and what is your / the rest's decision on the plugin config?

@shyim shyim merged commit 728cc0d into FriendsOfShopware:main Oct 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants