Fórum

Update email tmpl files in the Calendar Portlet

thumbnail
Johann Sonnenberg, modificado 6 Anos atrás.

Update email tmpl files in the Calendar Portlet

New Member Postagens: 20 Data de Entrada: 28/06/17 Postagens Recentes
I've been asked to change the content of the email reminders sent out by the Calendar Portlet. I found the file in the Liferay 7 Source under modules/apps/forms-and-workflow/calendar/calendar-service/src/main/resources/com/liferay/calendar/service/configuration/dependencies/email/booking_reminder_body.tmpl .

I created a new Liferay Module Project Fragment and put the file in what I thought was the same place. I built and deployed it to the server but when the email is sent, my changes are not in there. I've mixed up something here.

Attachments are the structure of the Liferay 7 Source and the structure of my module:

Any ideas and help would be appreciated!

Thanks!
thumbnail
Russell Bohl, modificado 6 Anos atrás.

RE: Update email tmpl files in the Calendar Portlet

Expert Postagens: 291 Data de Entrada: 13/02/13 Postagens Recentes
Before you get too far in debugging, the path you referenced in your post is not the correct one. you said:

I found the file in the Liferay 7 Source under modules/apps/forms-and-workflow/calendar/calendar-service/src/main/java/resources/com/liferay/calendar/service/configuration/dependencies/email/booking_reminder_body.tmpl


But the path doesn't have "java" in it. Looking at the screenshot of your IDE I don't think this is a real issue, I think it's a typo in your post, but I figured we could start there.
thumbnail
Johann Sonnenberg, modificado 6 Anos atrás.

RE: Update email tmpl files in the Calendar Portlet

New Member Postagens: 20 Data de Entrada: 28/06/17 Postagens Recentes
Thanks Russell,

Yeah I double checked and it is a type in my post. I'll fix that now.

Thanks.
thumbnail
Russell Bohl, modificado 6 Anos atrás.

RE: Update email tmpl files in the Calendar Portlet

Expert Postagens: 291 Data de Entrada: 13/02/13 Postagens Recentes
Okay, maybe try refreshing the host bundle (calendar-service). Using the gogo shell, first find the bundle ID, then refresh [bundleID], like this:

 $ telnet localhost 11311
...
____________________________
Welcome to Apache Felix Gogo

g! lb calendar
START LEVEL 20
   ID|State      |Level|Name
   57|Active     |   10|Liferay Calendar API (2.0.8)
   58|Active     |   10|Liferay Calendar Service (2.1.30)
   59|Active     |   10|Liferay Calendar Web (1.0.27)
g! refresh 58


See if that helps get your fragment picked up.
thumbnail
Johann Sonnenberg, modificado 6 Anos atrás.

RE: Update email tmpl files in the Calendar Portlet

New Member Postagens: 20 Data de Entrada: 28/06/17 Postagens Recentes
Hey Russell,

Here's what I tried in the GoGo shell:

____________________________
Welcome to Apache Felix Gogo

g! lb calendar
START LEVEL 20
ID|State |Level|Name
51|Resolved | 10|frcop-calendar-web (1.0.0)
149|Active | 10|Liferay Calendar API (2.0.8)
150|Active | 10|Liferay Calendar Service (2.1.31)
151|Active | 10|Liferay Calendar Web (1.0.29)
594|Resolved | 1|frcop-calendar-service (1.0.0)
g! refresh 594
g! lb calendar
START LEVEL 20
ID|State |Level|Name
51|Resolved | 10|frcop-calendar-web (1.0.0)
149|Active | 10|Liferay Calendar API (2.0.8)
150|Active | 10|Liferay Calendar Service (2.1.31)
151|Active | 10|Liferay Calendar Web (1.0.29)
594|Resolved | 1|frcop-calendar-service (1.0.0)


This did not resolve the problem. I did see in the console in Dev Studio that calendar service and calendar web were both stopped and started.

Thoughts? Thanks!
thumbnail
Russell Bohl, modificado 6 Anos atrás.

RE: Update email tmpl files in the Calendar Portlet

Expert Postagens: 291 Data de Entrada: 13/02/13 Postagens Recentes
Just to be clear, the Resolved state is fine for fragments. They'll never be activated. So you need to test the functionality and not rely on the bundle state of the fragment. You probably knew that already, I'm just making sure.

Here's another common tripping point with fragments: Double check that your fragment's bnd.bnd file has the exact version of the calendar-service module specified.

Wait, that's all still good advice so I'll leave it there, but I just noticed the calendar-service module specifies the templates in a portlet.properties file. You'll probably need to (in your fragment) provide a portlet-ext.properties, providing a different value for the existing

calendar.notification.body[email][reminder]=com/liferay/calendar/service/configuration/dependencies/email/booking_reminder_body.tmpl


property. Then name your own .tmpl file to match what you set there, and see if that works (you always need to refresh the host though. It won't automatically pick up the fragment).
thumbnail
Johann Sonnenberg, modificado 6 Anos atrás.

RE: Update email tmpl files in the Calendar Portlet

New Member Postagens: 20 Data de Entrada: 28/06/17 Postagens Recentes
I also checked for the path to that file in the Liferay 7 Source in the portlet.properties file for the Calendar Service.

Here is the entire line 9 from that file:

calendar.notification.body[reminder]=com/liferay/calendar/service/configuration/dependencies/email/booking_reminder_body.tmpl

I can set this to a different value in my portal-ext.properties file and see if that works?

Thoughts?
thumbnail
Russell Bohl, modificado 6 Anos atrás.

RE: Update email tmpl files in the Calendar Portlet

Expert Postagens: 291 Data de Entrada: 13/02/13 Postagens Recentes
Johann Sonnenberg:
I also checked for the path to that file in the Liferay 7 Source in the portlet.properties file for the Calendar Service.

Here is the entire line 9 from that file:

calendar.notification.body[reminder]=com/liferay/calendar/service/configuration/dependencies/email/booking_reminder_body.tmpl

I can set this to a different value in my portal-ext.properties file and see if that works?

Thoughts?


Yes, we were coming to that conclusion simultaneously emoticon, see my post above. Of course, set the path to the value of your custom template. so it gets your template instead of the default. If that doesn't work, I'm pretty much out of ideas. Let me know if it works.
thumbnail
Russell Bohl, modificado 6 Anos atrás.

RE: Update email tmpl files in the Calendar Portlet

Expert Postagens: 291 Data de Entrada: 13/02/13 Postagens Recentes
If that doesn't work, there's a simple way to do it via the UI. In the Calendar app, open up a particular calendar's Calendar Settings, then click the Notification Templates tab. You can edit the Invite or Reminder template directly from there. See attached GIF,
thumbnail
Johann Sonnenberg, modificado 6 Anos atrás.

RE: Update email tmpl files in the Calendar Portlet

New Member Postagens: 20 Data de Entrada: 28/06/17 Postagens Recentes
Here's what the bnd.bnd file is in the Liferay 7 Source:

Bundle-Name: Liferay Calendar Service
Bundle-SymbolicName: com.liferay.calendar.service
Bundle-Version: 2.0.6
Export-Package:\
com.liferay.calendar.model.impl,\
com.liferay.calendar.notification.impl,\
com.liferay.calendar.search,\
com.liferay.calendar.service.configuration,\
com.liferay.calendar.service.permission,\
com.liferay.calendar.upgrade.v1_0_2,\
com.liferay.calendar.util,\
com.liferay.calendar.workflow
Import-Package:\
!edu.emory.*,\
\
!groovy.*,\
\
!net.fortuna.*,\
\
!org.codehaus.*,\
*
Liferay-Releng-Module-Group-Description:
Liferay-Releng-Module-Group-Title: Calendar
Liferay-Require-SchemaVersion: 1.0.5
Liferay-Service: true
-includeresource:\
@backport-util-concurrent-[0-9]*.jar,\
@net.fortuna.ical4j-[0-9]*.jar

Here's what mine was:

Bundle-Name: frcop-calendar-service
Bundle-SymbolicName: frcop.calendar.service
Bundle-Version: 1.0.0
Fragment-Host: com.liferay.calendar.service;bundle-version="2.1.31"

But I changed the Bundle-Version to 2.0.6 and retested. Still no change.

I will try the portal-ext.properties file next. I'll let you know what I find out.

Thanks so much!
thumbnail
Johann Sonnenberg, modificado 6 Anos atrás.

RE: Update email tmpl files in the Calendar Portlet

New Member Postagens: 20 Data de Entrada: 28/06/17 Postagens Recentes
Hey Russell,

I added the booking_reminder_body.tmpl file to the resources/dependencies folder and setting that property in the portlet.properties file for my Calendar Service module. Restarted Liferay, and still it is not reading from it.

I see the steps in the gif you added. The problem is, is that we have dozens of sites in the application so I would have to make that change for every calendar, correct?

Any other ideas?

Thanks!
thumbnail
Russell Bohl, modificado 6 Anos atrás.

RE: Update email tmpl files in the Calendar Portlet

Expert Postagens: 291 Data de Entrada: 13/02/13 Postagens Recentes
Unfortunately, I'm out of ideas.
I'd recommend trying to draw more attention to this post by posting on the community slack group. If you're not already a member of the group, go here:
https://community-chat.liferay.com/

Of course, you'll want to link to this post as well.
thumbnail
Johann Sonnenberg, modificado 6 Anos atrás.

RE: Update email tmpl files in the Calendar Portlet (Resposta)

New Member Postagens: 20 Data de Entrada: 28/06/17 Postagens Recentes
I logged a ticket with support and they were able to provide me with a solution.

I put a portlet-ext.properties file in my calendar-service/src/main/resources folder and added in the key/value pairs for the email body and subject. So the structure looks like this:

calendar-service
- src
- - main
- - resources
- - portlet-ext.properties
- - - dependencies
- - - booking_reminder_body.tmpl
- - - booking_reminder_subject.tmpl

The portlet-ext.properties file contained these lines:
calendar.notification.body[ email ][reminder]=dependencies/booking_reminder_body.tmpl
calendar.notification.subject[ email ][reminder]=dependencies/booking_reminder_subject.tmpl

Thanks Russell for all your help and I hope this helps someone along the way.
thumbnail
Russell Bohl, modificado 6 Anos atrás.

RE: Update email tmpl files in the Calendar Portlet

Expert Postagens: 291 Data de Entrada: 13/02/13 Postagens Recentes
Glad you got it working!

Just to be clear, you did this from a fragment bundle?
thumbnail
Johann Sonnenberg, modificado 6 Anos atrás.

RE: Update email tmpl files in the Calendar Portlet

New Member Postagens: 20 Data de Entrada: 28/06/17 Postagens Recentes
Yup! From Liferay Developer Studio, I right-clicked my project and selected New --> Liferay Module Project Fragment.
Gayathri M, modificado 6 Anos atrás.

RE: Update email tmpl files in the Calendar Portlet

New Member Postagens: 13 Data de Entrada: 22/12/16 Postagens Recentes
Hi,

Can anyone tell how to stop sending notifications for calendar portlet in liferay 7?
thumbnail
Russell Bohl, modificado 6 Anos atrás.

RE: Update email tmpl files in the Calendar Portlet

Expert Postagens: 291 Data de Entrada: 13/02/13 Postagens Recentes
Unfortunately, I believe the answer is a simple one: you can't.