How to add a new message template?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
Hace 11 años
Hi,

is it possible to add a new message template? If so, can you provide sample code to send an email?

Thanks in advance!
Hace 11 años
Hi,

You can add a new message template using SQL-query to your database.

For example,

IF NOT EXISTS (
   SELECT 1
   FROM [dbo].[MessageTemplate]
   WHERE [Name]=N'YourMessageTemplate')
BEGIN
INSERT [dbo].[MessageTemplate] ([Name], [BccEmailAddresses], [Subject], [Body], [IsActive], [EmailAccountId])
VALUES (N'YourMessageTemplate', NULL, N'%Store.Name%. Hello!', N'<p> Hi! This message from% Store.Name% </ p> ', 'true', 1)
END
GO

For 2.80.

Then you can edit it in the admin area.
Hace 11 años
Mariann wrote:
Hi,

You can add a new message template using SQL-query to your database.

For example,

IF NOT EXISTS (
   SELECT 1
   FROM [dbo].[MessageTemplate]
   WHERE [Name]=N'YourMessageTemplate')
BEGIN
INSERT [dbo].[MessageTemplate] ([Name], [BccEmailAddresses], [Subject], [Body], [IsActive], [EmailAccountId])
VALUES (N'YourMessageTemplate', NULL, N'%Store.Name%. Hello!', N'<p> Hi! This message from% Store.Name% </ p> ', 'true', 1)
END
GO

For 2.80.

Then you can edit it in the admin area.


thanks.

and how can i call this new template ?
probably only from source code, right ?

Shay
Hace 11 años
Yes. If you want to use this message template to send, you need to edit the code.
Hace 11 años
Can someone please provide sample code?
Hace 11 años
What code do you mean?
Hace 11 años
Source code showing how to send an e-mail which is using a message template.
Thanks
Hace 11 años
To all: when suggesting or referring to a page or template item or otherwise to edit/modify, please, please, please be specific.
Which page name, located where?  With MVC there are often 2-4 places where code needs to be modified. And in nopC there are several cs pages that could be confused as which ones.  So, kindly, be specific.
Hace 11 años
@e-novative: If you would have read the post, you would see that nobody is suggesting or referring to a page or template item.
I was just asking for a simple code example, which shows how to send an email using a message template. Anyway, guess it's easier to look for that code by myself.
Hace 10 años
[email protected] wrote:
Source code showing how to send an e-mail which is using a message template.
Thanks


Agreed, som sample code about this would help alot with some explanation.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.