How can I add custom course field in middle of a text

How can I add custom course field in middle of a text

by Mohamed Atia -
Number of replies: 0

We created many course fields and user fields and we want to display them in a middle of a text for example I have

  1. CourseType this can be ( Workshop, Webinar, Awareness Session, Course .....)
  2. Institution this can be (College of Medicine, College of Engineering, English Center, IT Deanship, etc....).
  3. certificate (Attendance Certificate , thanks certificate, Pass certificate  )

and in the certificate, I want to write something like

{certificate}
This certificate is issued by {Institution} to certify 
Mark Nelson 
has attended {CourseType} titled {Course Name}

this will appear in the certificate and emailed certificate as 

Attendance Certificate
This certificate is issued by The College of Medicine to certify 
Mark Nelson 
has attended Awareness Session titled How to protect yourself from corona infection. 

I tried the filter code plugin which was very useful and work great when the user clicks on the view certificate, but the emailed certificate does not appear correctly, it views the default field values for example the above will display wrong or empty values as below 

{}
This certificate is issued by Taif University
 to certify 
Mark Nelson
 
has attended {} titled {}

 Plugin URL https://moodle.org/plugins/filter_filtercodes

and when I use certificate course field elements, it is very difficult to format the text as the values are different in the number of charecters  which may cause words to overlap or display extra empty spaces 

my question what is the best way to put the custom course fields in the middle of the text that displayed correctly when viewed via browser, or received via email 

Average of ratings: -