I am working with two arrays and an object in my project. The first array contains product codes, while the second array contains the quantities of each product. The quantities array corresponds to the product codes array, meaning the first quantity in the quantities array is for the first product code in the product codes array. Additionally, I have an object that holds customer data structured like this:
customer={
name:' firstname lastname',
email: '<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="ceabb6afa3bea2ab8eaaa1a3afa7a0e0ada1a3">[email protected]</a>',
company: "company name",
phone_number: 'phone number',
}
The product codes array and quantities array are as follows:
product_codes=[code_1; code_2; code_3];
quantities=[23, 56, 45];
All this information is intended to be sent to [email protected].
I know the basics of using the mailto function, but I am looking for a way to format the email body as specified below:
...................................
Name: customer.name
email: customer.email
company name: customer.company
phone number: customer.phone_number
product code 1: corresponding quantity
product code 2: corresponding quantity
product code 3: corresponding quantity
...............................................
I also need to dynamically add any other product codes and quantities, as the number is variable in each case. Is this feasible? If yes, how can it be achieved? Kindly provide a detailed explanation for practical implementation. Thank you!
If my query is unclear, please let me know so I can clarify it further.