Writing a console script on RNR to send emails to users
64 USD* *
The details:
1.1) A config file with access to the BD and the value of NN must be
2.1) Before sending the mail you need to generate discount_hash and the user link type `*site name/?discount=%discount_hash%*`
2.2) the html template with text will be saved in a separate file, you will need to submit only the discount size and link, the format can be discussed, I would suggest the variables in the file submit through str_replace, without the blade/twig type templates
2.3) you need to save the field discount_hash, email_sent_status (in any case)
2.4) if the shipment failed - to keep the shipment attempt in the BD call, after 3 failed attempts the shipment had to remove the line from the BD
4) the log must be stored for a week.For convenience, you can take any liba (e.g. monolog/monolog)
Таблица в БД уже есть, я скину структуру данных исполнителю.
Скрипт должен быть написан по стандарту PSR-12, работать с РНР7.4 и РНР8, желательно в каждом классе прописать `declare(strict_types=1)`. Желательно перед сдачей проекта проверить код линтером: phpstan or psalm на базовом уровне.
Скрипт будет по крону работать. Он должен:
- выбрать из таблицы БД список из NN пользователей, которым имейл рассылка не была отправлена (SELECT * FROM email_subscriptions WHERE email_sent_status = 0)
- отправить (попытаться) html имейл каждому пользователю из списка
- после успешной отправки имейла сохранить флаг "отправлено" email_sent_status = 1
- вывести на экран и в лог-файл информацию: сколько строк из БД выбрано, сколько имейлов отправлено, сколько имейлов отправить не получилось (сколько и каких было удалено, если были удаления)
****
Детали:
1.1) Должен быть конфиг файл с доступами к БД и значением NN
2.1) перед отправкой имейла нужно сгенерировать discount_hash и ссылку для пользователя вида `*название.сайта/?discount=%discount_hash%*`
2.2) html шаблон с текстом будет сохранён в отдельном файле, нужно будет подставить только размер скидки и ссылку, формат может обсудить, я предложил бы переменные в файл подставлять через str_replace, без шаблонизаторов вида blade/twig
2.3) нужно сохранить в БД поля discount_hash, email_sent_status (в любом случае)
2.4) если отправка завершилась неуспешно — сохранить в БД кол-во попыток отправки, после 3-х неудачных попыток отправки имейла удалить строку из бд
4) логи должны храниться неделю. Для удобства можно взять любую либу (например monolog/monolog)
Отправку имейлов хотелось бы сделать через unisender.
Client's feedback on cooperation with Mykola P.
Writing a console script on RNR to send emails to usersEverything is great, I can recommend Mickola as a professional.
It was important for me that the code and architecture of the RNR applications were created in a modern style and with the possibility of further scalability. And the task was fulfilled, as agreed, with comments and discussions on the course of the project. That is why everything is good.
Profile deleted | Safe
Freelancer's feedback on cooperation with client
Writing a console script on RNR to send emails to usersan interesting task.
The customer understands what he wants.
I, as always, failed a little time, but the demands were met.
I recommend cooperation.
Current freelance projects in the category PHP
Laravel developer with skills working with SphinxHello, I am looking for a Laravel developer who can help improve the current functionality of one of the projects. Skills in working with Sphinx are important, as well as the ability to work with JS at a more or less basic level. Please specify the cost of 1 hour of your work in… PHP, Web programming ∙ 1 proposal |
Develop a responsive website and integrate it into the Wordpress engineAdaptively layout a multi-page website and integrate it into the Wordpress engine. Budget and deadlines are specified in the project. It is mandatory to report on the progress of the work. Edit all website content. After development, it will need to be transferred to our hosting… HTML and CSS, PHP ∙ 10 proposals |
Change the appearance of Woocommerce CheckoutNeed to create an order checkout page (standard Woocommerce page) like on avtozvuk.ua store. Also, add delivery methods "Nova Poshta" and "Ukrposhta". Additionally: Integrate SMS notifications for order status and SMS verification. In the application, write two amounts. PHP, Web programming ∙ 4 proposals |
Set up a Wordpress/WooCommerce storeInstall and configure Wordpress (Phlox Pro theme) + WooCommerce Set up Ukrainian translation, main page appearance, product page, and product catalog. Configure the order placement process. Add delivery modules Nova Poshta, Ukrposhta, payment (Monobank acquiring), Keu crm We… PHP, Web programming ∙ 10 proposals |
"Magento 2.4.6 adding a product through attributes"Problem: The website has many products that can be sold together with other products. Products need to be added through an attribute in the configuration product. For example: A computer mouse is available in different colors, and a mouse pad can be purchased with it (although… PHP, Web programming ∙ 3 proposals |