diff --git a/plugins/discourse-narrative-bot/lib/discourse_narrative_bot/certificate_generator.rb b/plugins/discourse-narrative-bot/lib/discourse_narrative_bot/certificate_generator.rb
index 75ce1cefb3d..ad805ae8d9b 100644
--- a/plugins/discourse-narrative-bot/lib/discourse_narrative_bot/certificate_generator.rb
+++ b/plugins/discourse-narrative-bot/lib/discourse_narrative_bot/certificate_generator.rb
@@ -22,545 +22,24 @@ module DiscourseNarrativeBot
def new_user_track
width = 538.583 # Default width for the SVG
-
- svg = <<~SVG
-
- SVG
+ ApplicationController.render(inline: File.read(File.expand_path('../templates/new_user.svg.erb', __FILE__)),
+ assigns: { width: width,
+ discobot_user: @discobot_user,
+ date: @date,
+ avatar_url: base64_image_link(avatar_url),
+ logo_group: logo_group(55, width, 350),
+ name: name })
end
def advanced_user_track
width = 722.8 # Default width for the SVG
-
- <<~SVG
-
- SVG
+ ApplicationController.render(inline: File.read(File.expand_path('../templates/advanced_user.svg.erb', __FILE__)),
+ assigns: { width: width,
+ discobot_user: @discobot_user,
+ date: @date,
+ avatar_url: base64_image_link(avatar_url),
+ logo_group: logo_group(40, width, 280),
+ name: name })
end
private
diff --git a/plugins/discourse-narrative-bot/lib/discourse_narrative_bot/templates/advanced_user.svg.erb b/plugins/discourse-narrative-bot/lib/discourse_narrative_bot/templates/advanced_user.svg.erb
new file mode 100644
index 00000000000..e5bccc08237
--- /dev/null
+++ b/plugins/discourse-narrative-bot/lib/discourse_narrative_bot/templates/advanced_user.svg.erb
@@ -0,0 +1,56 @@
+
diff --git a/plugins/discourse-narrative-bot/lib/discourse_narrative_bot/templates/new_user.svg.erb b/plugins/discourse-narrative-bot/lib/discourse_narrative_bot/templates/new_user.svg.erb
new file mode 100644
index 00000000000..298f6119c7a
--- /dev/null
+++ b/plugins/discourse-narrative-bot/lib/discourse_narrative_bot/templates/new_user.svg.erb
@@ -0,0 +1,473 @@
+