{
"email": "",
"customerId": "",
"region": "",
"event": "update_user",
"keys":[
Recently, Birchbox moved non-transactional emails from Selligent to Braze(tech doc). This page is mainly a quick reference of braze events being sent within Magento.
All Braze configurations(endpoint url, api key, threshold etc) could be found in magento admin UI. They are under System -> Configuration -> Birchbox APIs.
relevant code is here
In Magento, there is a helper class(EventPost.php) which includes all the fundamental methods(read configurations, send post request to Braze endpoint) for braze event post.
Any further implementations should also go to this class to avoid duplicated code.
braze.rb contains basic functionalities to interact with Braze endpoint.
Currently, we only include UserTracker module/class.
Beuty/Grooming update event: code
On beauty/grooming profile page, everytime user selects different option will trigger a request to update her/his profile. Right after new profile is updated, a post request to Braze user track endpoint will also be sent.
payload:
- INC_ENDPOINT = "og/src/main/php/com/birchbox/og/cli/dotcom/DotcomCLI.php" (by post_inventory_increment)
- DEC_ENDPOINT = "_birchboxadmin/logistics/decrement_inventorycountCLI.php"(by post_inventory_decrement)
- tools server:
ohl_item_master - https://{tools-server}/api/ohl_item_master
rc-file-importer - https://{tools-server}/api/rc-file-importer - erp_integration: etl_pass.py
- DME:
./run.sh us (-s) -t CSH****
RAF codes have been already created in referral_code
table(I guess it's created along with new account)
Both referral and nudge email are sent by magento via cron job:
DME shipment file import process:
- import line by line
- get shipment by incrementId(order id lie BB*****)
- run query
Select * from birchbox_shipment_history WHERE increment_id =
- shoud return shipment, tracking number should be empty and status should be processing
- run query
- update shipment
- run query
UPDATE birchbox_shipment_history SET status = 'completed', shipped_at = NOW(),
- run query
curl https://tools.team.birchbox.com/api/pim/products/product_or_sample_by_upcs?upc=838760000035 |
- the page shows Product Attribute View which is mainly from a view pim_product_attributes_view. The view does a bunch of table join. The drawback of it is there is no way for us to utilize index to speed up querying. The view does provide very details of product attribute but I don’t think in PIM/Products page, we utilize most of them. The attributes we currently care about are vendor name, product name, vendor sku, magento id, category department, category class, category subclass, unique_id and status. These attributes are what we list on the page and we performance search function against them as well.
- One potential solution is manually join necessary tables so that we can optimize the query by using indexes instead of reading entries from the view. Also, we can eager load tables to avoid N+1 query which is not a major issue regarding to the performance.
- some tests against sql with necessary tables joined together.
origin sql:
SELECT vendor_name, name, cat_department, cat_cl
- the update/create method in the backend is pretty straight forward. Since a product is associated with multiple attributes, every time in order to create/update product, all the attributes need to be created/updated which take some reasonable time(4s-5s). I think the issue is after update the product, page would be redirected to /pim/products page. This is the page where we could do some optimization. In my dev, to load this page would cause 6s
- another thing could be improved is edit/new product page loading time. Currently, without eager loading attributes, the page takes 7.5+s to load. With some eager load tweaks, the time could drop to 4.5s. The page load could be cut off 3s.
- in bbop-orders, some logs shows no shipping method. In the code, if no shipping method, order won't be forwarded to bbop-shipments
15:36:41.060 [pool-2-thread-151] WARN ?.(:): Order complete with included items but no shipping method: 129665819
15:37:49.335 [pool-2-thread-54] WARN ?.(:): Order complete with included items but no shipping method: 129665835
15:38:06.454 [pool-2-thread-127] WARN ?.(:): Order complete with included items but no shipping method: 129665837
15:41:40.352 [pool-2-thread-110] WARN ?.(:): Order complete with included items but no shipping method: 129665871
15:42:25.285 [pool-2-thread-139] WARN ?.(:): Order complete with included items but no shipping method: 129665879
15:43:05.041 [pool-2-thread-104] WARN ?.(:): Order complete with included items but no shipping method: 129665886
15:43:20.865 [pool-2-thread-36] WARN ?.(:): Order complete with included items but no shipping method: 129665889
15:45:33.296 [pool-2-thread-169] WARN ?.(:): Order complete with included items but