Fix JavaScript error in EmailTemplatePreview

- Fix "nama is not defined" error by properly escaping shortcode text
- Wrap template literals with backticks in JSX to prevent variable interpretation
- This prevents shortcode braces from being treated as JavaScript variables

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
dwindown
2025-12-22 22:07:54 +07:00
parent 204218c4e7
commit 3f8cd7937a

View File

@@ -215,14 +215,14 @@ export function EmailTemplatePreview({
(template.email_body_html && template.email_body_html.includes('{'))) && (
<div className="mt-3 pt-3 border-t border-blue-200">
<p className="text-xs text-blue-700">
<strong>All Available Shortcodes:</strong> User ({nama}, {email}), Orders ({order_id}, {tanggal_pesanan}, {total}, {metode_pembayaran}, {status_pesanan}, {invoice_url}),
Products ({produk}, {kategori_produk}, {harga_produk}),
Access ({link_akses}, {username_akses}, {password_akses}),
Consulting ({tanggal_konsultasi}, {jam_konsultasi}, {link_meet}),
Events ({judul_event}, {tanggal_event}, {link_event}),
Bootcamp ({judul_bootcamp}, {progres_bootcamp}, {modul_selesai}),
Payment ({bank_tujuan}, {nomor_rekening}, {jumlah_pembayaran}),
Company ({nama_perusahaan}, {email_support})
<strong>All Available Shortcodes:</strong> User ({`{nama}`}, {`{email}`}), Orders ({`{order_id}`}, {`{tanggal_pesanan}`}, {`{total}`}, {`{metode_pembayaran}`}, {`{status_pesanan}`}, {`{invoice_url}`}),
Products ({`{produk}`}, {`{kategori_produk}`}, {`{harga_produk}`}),
Access ({`{link_akses}`}, {`{username_akses}`}, {`{password_akses}`}),
Consulting ({`{tanggal_konsultasi}`}, {`{jam_konsultasi}`}, {`{link_meet}`}),
Events ({`{judul_event}`}, {`{tanggal_event}`}, {`{link_event}`}),
Bootcamp ({`{judul_bootcamp}`}, {`{progres_bootcamp}`}, {`{modul_selesai}`}),
Payment ({`{bank_tujuan}`}, {`{nomor_rekening}`}, {`{jumlah_pembayaran}`}),
Company ({`{nama_perusahaan}`}, {`{email_support}`})
</p>
</div>
)}