Buy Now
Sign in

Custom Email / Multiple Selections

jformicola , February 07 2020, 20:28
J
jformicola 43
February 07 2020, 20:28 #391095
Hi!
I'm trying to have the data from the below "Read data" show up on a custom email. The issue is that there are multiple values stored in "TrainedTopics" how do I get them all to end up in the email?
Custom_Email.jpg
TrainedTopics.jpg
  [read_data36] => Array
(
[log] => Array
(
[0] => SELECT `Data36`.`ID` AS `Data36.ID`, `Data36`.`subject` AS `Data36.subject`, `Data36`.`Notes_For_Trainer` AS `Data36.Notes_For_Trainer`, `Data36`.`Instruction_Resource_1` AS `Data36.Instruction_Resource_1`, `Data36`.`Instruction_Resource_2` AS `Data36.Instruction_Resource_2` FROM `tbltrainedtopics` AS `Data36` WHERE `Data36`.`ID` IN ('2', '3') LIMIT 100;
)

[var] => Array
(
[0] => Array
(
[Data36] => Array
(
[ID] => 2
[subject] => MRI - Navigate the Calendar
[Notes_For_Trainer] => difference between navigating and advancing
[Instruction_Resource_1] => http://trainkamson.com/index.php?option=com_content&view=article&id=20
[Instruction_Resource_2] =>
)

)

[1] => Array
(
[Data36] => Array
(
[ID] => 3
[subject] => MRI - Adding a Guest Card
[Notes_For_Trainer] =>
[Instruction_Resource_1] => http://trainkamson.com/index.php?option=com_content&view=article&id=20
[Instruction_Resource_2] =>
)

)

)

)
healyhatman 9
February 08 2020, 00:06 #391100
{var.join[<br>]:read_data36.[n].Data36.subject}
Web developer at SkySpider.com.au - I DO NOT work for ChronoEngine!
Donations: paypal.me/healyhatman
Professional Work: kamron@skyspider.com.au
Custom CF / CC Plugins and Extensions: skyspider.com.au/store
J
jformicola 43
February 08 2020, 06:25 #391103
oh nice, seems crafty, thanks! So that uses the join function to create a list one on each line? I also want to output the resource 1 and resource 2 for each of the subjects too. So I imagine I can use the same code for those two fields and put them in some sort of html to create a table structure right? Will the alignment be off if there is a null in resource 2 for some of the selections?
I'm trying to get this basic structure in the table
Subject | Resource 1 | Resource 2
Subject1 | Resource 1-1 | Resource 2-1
Subject 2 | Resource 1-2| Resource 2-2
etc.
healyhatman 9
February 08 2020, 07:50 #391105
Well use a table then if you want it in a table
Web developer at SkySpider.com.au - I DO NOT work for ChronoEngine!
Donations: paypal.me/healyhatman
Professional Work: kamron@skyspider.com.au
Custom CF / CC Plugins and Extensions: skyspider.com.au/store
J
jformicola 43
February 08 2020, 15:05 #391110
Haha, ok thanks! Sorry, I haven't done most of these things before so I don't know what works. So it sounds like you've given me all the pieces I need (other than an HTML table structure, but I can google that I imagine) I'll try Monday. Thanks for your help!
J
jformicola 43
February 10 2020, 17:56 #391127
Hi healyhatman!
This is what I came up with. Seems to work except I can't get there to be borders between each row. I've tried a bunch of things from the internet, but they don't seem to be working. Is there anyway you might be able to help with that? I just want there to be a black line between each row and nothing seems to work...
<head>
<style>
table, th, td {
padding: 10px;
border: 1px solid black;
border-collapse: collapse;
}
</style>
</head>
<body>
<table>
<tr>
<th>Subject</th>
<th>Resource 1</th>
<th>Resource 2</th>
</tr>
<tr>
<td> {var.join[<br>]:read_data36.[n].Data36.subject}</td>
<td>{var.join[<br>]:read_data36.[n].Data36.Instruction_Resource_1}</td>
<td >{var.join[<br>]:read_data36.[n].Data36.Instruction_Resource_2}</td>
</tr>
</table>
</body>
Email.jpg
Attachments
Email.jpg
Email.jpg
(58.18 KiB)
151 Downloads/Views
J
jformicola 43
February 10 2020, 18:04 #391128
What I mean is if it would just show the row/cell borders, that would be perfect.
healyhatman 9
February 10 2020, 23:26 #391130
Just add style to it, like <td style="border: 1px solid black"> for example
Web developer at SkySpider.com.au - I DO NOT work for ChronoEngine!
Donations: paypal.me/healyhatman
Professional Work: kamron@skyspider.com.au
Custom CF / CC Plugins and Extensions: skyspider.com.au/store
J
jformicola 43
February 11 2020, 19:45 #391141
Thanks, but that didn't work. I think I just realized why. It is seeing that whole block as one cell do to the way we're getting our data via the join, no? So I guess I'll just have to live with it?
J
jformicola 43
February 24 2020, 22:03 #391365
Hi healyhatman!
I ended up using this same idea for another form I'm using, which creates a printable pdf checklist with the tcpdf function. Is there a way to get a checkbox to display before each line here? Thanks!
<table>
<tbody>
<tr>
<th>Subject</th>
<th>Notes</th>
</tr>
<tr>
<td style="border: 1px solid black;">{var.join[<br />]:read_data19.[n].Data19.subject}</td>
<td style="border: 1px solid black;">{var.join[<br />]:read_data19.[n].Data19.Notes_For_Trainer}</td>
</tr>
</tbody>
</table>
healyhatman 9
February 25 2020, 00:18 #391369
You can either just put in <input type="checkbox"> or use any of the unicode boxes like ☐
Web developer at SkySpider.com.au - I DO NOT work for ChronoEngine!
Donations: paypal.me/healyhatman
Professional Work: kamron@skyspider.com.au
Custom CF / CC Plugins and Extensions: skyspider.com.au/store
J
jformicola 43
February 25 2020, 14:20 #391376
Thanks Healy, I surmised as much, I just can't figure out where to put that into the html above to have the it display before each row (not for a lack of trying either) Any chance you can just tell me where to put it exactly and put me out of misery?
healyhatman 9
February 25 2020, 20:44 #391380
as part of the join. [<br>boxicon]
Don't forget to put a box in for the first row though
Web developer at SkySpider.com.au - I DO NOT work for ChronoEngine!
Donations: paypal.me/healyhatman
Professional Work: kamron@skyspider.com.au
Custom CF / CC Plugins and Extensions: skyspider.com.au/store
J
jformicola 43
February 26 2020, 13:48 #391387
I couldn't get a checkbox unicode or otherwise to work, but the curly brackets did, so that should be fine... thanks!
<td style="border: 1px solid black">{}{var.join[<br>{}]:read_data19.[n].Data19.subject}</td>
<td style="border: 1px solid black">{var.join[<br>]:read_data19.[n].Data19.Notes_For_Trainer}</td>