定制 remp/crm-remp-mailer-module 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

remp/crm-remp-mailer-module

Composer 安装命令:

composer require remp/crm-remp-mailer-module

包简介

CRM Mailer Module

README 文档

README

REMP Mailer Module is an integration module connecting CRM with REMP Mailer.

Module adds listener for NotificationEvent to send emails, and attaches widgets to allow users/admins to configure newsletter subscriptions and to see logs of all sent emails in administration.

Installing module

We recommend using Composer for installation and update management.

composer require remp/crm-remp-mailer-module

Enabling and configuring module

Add installed extension to your app/config/config.neon file.

extensions:
	remp_mailer: Crm\RempMailerModule\DI\RempMailerModuleExtension

When added, you need to provide URL of REMP Mailer instance and API token that CRM should use to communicate with Mailer.

Amend your configuration file and replace the example values with real ones:

remp_mailer:
    # Base URL where mailer is hosted.
    host: http://mailer.remp.press

    # API token to communicate with Mailer. By default the token can be acquired in REMP SSO.
    api_token: abcdef123456789

If the configuration is incomplete, initialization will log an error to your configured logger and won't enable the module in CRM.

When everything is ready, make sure you update CRM internal configuration by running following commands (they should always be part of your release process):

php bin/command.php api:generate_access
php bin/command.php application:seed

Configurable services

You can disallow subscription to newsletters for users which haven't been confirmed yet (based on users.confirmed_at DB column). The feature is disabled by default and you can enable it by adding following snippet to your config.neon:

services:
	mailerMailerConfig:
		setup:
			- setSubscribeOnlyConfirmedUser(true)

API documentation

All examples use http://crm.press as a base domain. Please change the host to the one you use before executing the examples.

All examples use XXX as a default value for authorization token, please replace it with the real tokens:

  • API tokens. Standard API keys for server-server communication. It identifies the calling application as a whole. They can be generated in CRM Admin (/api/api-tokens-admin/) and each API key has to be whitelisted to access specific API endpoints. By default the API key has access to no endpoint.
  • User tokens. Generated for each user during the login process, token identify single user when communicating between different parts of the system. The token can be read:
    • From n_token cookie if the user was logged in via CRM.
    • From the response of /api/v1/users/login endpoint - you're free to store the response into your own cookie/local storage/session.

API responses can contain following HTTP codes:

Value Description
200 OK Successful response, default value
400 Bad Request Invalid request (missing required parameters)
403 Forbidden The authorization failed (provided token was not valid)
404 Not found Referenced resource wasn't found

If possible, the response includes application/json encoded payload with message explaining the error further.

POST /api/v1/mailer/subscribe

API endpoint calls REMP Mailer api endpoint and subscribes user to given mail type and variant.

Headers:
Name Value Required Description
Authorization Bearer String yes User token.
Example:
curl --location --request POST 'http://crm.press/api/v1/mailer/subscribe' \
--header 'Authorization: Bearer XXX' \
--form 'mail_type_code="alerts"' \
--form 'variant_code="daily"'

Response:

{
    "status": "ok"
}

POST /api/v1/mailer/unsubscribe

API endpoint calls REMP Mailer api endpoint and unsubscribes user to given mail type and variant.

Headers:
Name Value Required Description
Authorization Bearer String yes User token.
Example:
curl --location --request POST 'http://crm.press/api/v1/mailer/unsubscribe' \
--header 'Authorization: Bearer XXX' \
--form 'mail_type_code="alerts"' \
--form 'variant_code="daily"'

Response:

{
    "status": "ok"
}

remp/crm-remp-mailer-module 适用场景与选型建议

remp/crm-remp-mailer-module 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 49.06k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2020 年 06 月 26 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 remp/crm-remp-mailer-module 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 remp/crm-remp-mailer-module 我们能提供哪些服务?
定制开发 / 二次开发

基于 remp/crm-remp-mailer-module 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 49.06k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 3
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 6
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-06-26