Splitting dataset into groups and process each group seperately
I'm new to dataiku and any help would be appreciated, I have a scenario where I have to send mail to sales representative which contains questions asked by its associated client (customer that he manages)
eg Input
SR_Mail | Client_name | Question |
— - - - - - - - - - - - - - - - - -
abc@def.com | SBC | ABCD ? |
abc@def.com | SBC | POQJW ? |
abc@def.com | HHF | hfadhskjf ? |
defs@def.com | HHD | JJSHS ? |
asdd@def.com | DSGDHJ | DSJS ? |
I want to send the mail in table format so eg mail should contain table with following details.
Lets take above example The mail SR_Mail abc@def.com should receive
— - - - - - — - - - — - - - - - - - - - - - - - -
Client_Name | Questions
— - - - - - - - - - - - - - - - - - - - - -
SBC | ABCD ? , POQJW ?
HHF | hfadhskjf ?
— - - - - — - - — — - - - - - - - -
- Now I know we can use send_email plugin which has ability to build tables using html and it supports jinja templating so I can iterate over rows so if there is any way that I can create groups of individual MR and then iterate over to build a table out of those groups.
- Second Approach would be store the groups in individual files and then process each file seperately both using python receipes.
I want to know if there is better way to do this apart from the above 2 approaches
Operating system used: Linux
Operating system used: Linux
Operating system used: Linux
Operating system used: Linux
Operating system used: Linux
Answers
-
Turribeach Dataiku DSS Core Designer, Neuron, Dataiku DSS Adv Designer, Registered, Neuron 2023 Posts: 2,088 Neuron
First of all you don't need to split the data into separate files to have a Python recipe send emails. A Python recipe can load the whole dataset and loop through the data in whichever way you want grouping data and emails as needed. As per your other post I replied to you probably should not use the send_mail plugin and either use the Dataiku API send() method or pure Python SMTP code. In terms of sending HTML you don't need to do anything special, if you include the HTML code in the email body most email clients will render it.