Closed Ocean15 closed 6 years ago
Strategy of implementation: 1) Modify Send-dApp REST-API Call opt-in to support multiple senders e.g.
curl -X POST -H 'X-User-Id: y5arpuMfcHwNsBPoi' -H 'X-Auth-Token: SvdMYqMHMFb3saiSEXbzV3jXPwJ_ZilTXlZdGH1RRQM' -i 'http://localhost:3000/api/v1/opt-in?recipient_mail=nico20180712_1314@le-space.de&sender_mail=info@doichain.org&sender_mail=info@sendeffect.de'
results in an array of param sender_mail. In this case we extract the array in https://github.com/Doichain/dapp/blob/master/server/api/rest/imports/send.js#L22 and call addOptIn for every element. The addOptIn method gets a new parameter which marks the index. Calls without an index are "normal" SOIs.
2) Send out a SOI transaction on the blockchain for every co-sender with a nameId which is extended by an index e.g. -1 or -2 or -3
3) in case the confirm-dApp discovers a nameID with index, it collects all SOI data first and sends out only 1 DOI-request email (the one without index - which is the main sponsor or masterDOI)
4) If the user confirms a DOI the confirm-dApp internally confirms the DOI with the correct nameId AND(!) all other DOI's with this masterDOI (which belong to this DOI request).
5) the nameId for a co-sponsored DOI must be the same for all co-sponsors except the index at the end. e.g. e/4625AB7952C893E92547F56F633FD95361D37EA027CBBA10DC402CE87705320C-1
A common way in email marketing is to have co doi registrations. We should support that feature somehow too. Can be part of an external module.