Skip to content

Commit

Permalink
Merge pull request #334 from navikt/TOLK-2365-epost-om-påmelding-kurs
Browse files Browse the repository at this point in the history
Tolk-2365 :  Som kurseier ønsker jeg mulighet for å få en mail for hver påmelding på kurs
  • Loading branch information
olsenrasmus authored Apr 22, 2024
2 parents a2f0c89 + cb4aeaa commit 0f1f7b2
Show file tree
Hide file tree
Showing 8 changed files with 258 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!DOCTYPE html>
<html style="overflow-y: hidden;">
<head><meta><meta content="width=device-width, initial-scale=1.0" name="viewport">
<title></title>
<style type="text/css">body { margin: 0; padding: 0; }
</style>
</head>
<body style="height: auto; min-height: auto;">
<table bgcolor="#FFFFFF" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td align="center"><img alt="NAV Logo" src="https://navdialog.my.salesforce.com/servlet/servlet.ImageServer?id=0152o000005v5nL&oid=00D2o000000aANV" style="display:block; margin: 0 auto;" width="134" />
<p style="font-family: 'Source Sans Pro', Tahoma, Verdana, Segoe, sans-serif; font-size: 20px; color: #3e3832; line-height: 1.5; text-align: center;">En ny deltaker har meldt seg p&aring; kurset {{{courseName}}}</p>

<p style="font-family: 'Source Sans Pro', Tahoma, Verdana, Segoe, sans-serif; font-size: 14px; color: #3e3832; line-height: 1.5; text-align: center;">[Dette er en automatisk generert epost. Du f&aring;r dette varselet fordi du er eier av et kurs og &oslash;nsket varsel ved hver p&aring;melding]</p>
</td>
</tr>
</tbody>
</table>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<EmailTemplate xmlns="http://soap.sforce.com/2006/04/metadata">
<available>true</available>
<encodingKey>UTF-8</encodingKey>
<name>courseNewParticipant</name>
<style>none</style>
<subject>Ny påmelding til kurs</subject>
<type>custom</type>
<uiType>SFX</uiType>
</EmailTemplate>
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,20 @@
</itemInstances>
<itemInstances>
<fieldInstance>
<fieldInstanceProperties>
<name>uiBehavior</name>
<value>none</value>
</fieldInstanceProperties>
<fieldItem>Record.Notify_me_on_new_participants__c</fieldItem>
<identifier>RecordNotify_me_new_participants_cField</identifier>
</fieldInstance>
</itemInstances>
<itemInstances>
<fieldInstance>
<fieldInstanceProperties>
<name>uiBehavior</name>
<value>none</value>
</fieldInstanceProperties>
<fieldItem>Record.OwnerId</fieldItem>
<identifier>RecordOwnerIdField</identifier>
</fieldInstance>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,187 @@
<?xml version="1.0" encoding="UTF-8"?>
<Flow xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>60.0</apiVersion>
<decisions>
<name>notify_owner_or_not</name>
<label>notify owner or not</label>
<locationX>182</locationX>
<locationY>431</locationY>
<defaultConnectorLabel>Default Outcome</defaultConnectorLabel>
<rules>
<name>notify_owner_is_true</name>
<conditionLogic>and</conditionLogic>
<conditions>
<leftValueReference>get_course.Notify_me_on_new_participants__c</leftValueReference>
<operator>EqualTo</operator>
<rightValue>
<booleanValue>true</booleanValue>
</rightValue>
</conditions>
<connector>
<targetReference>create_email_to_course_owner</targetReference>
</connector>
<label>notify owner is true</label>
</rules>
</decisions>
<environments>Default</environments>
<interviewLabel>Notify course owner on new participant registration {!$Flow.CurrentDateTime}</interviewLabel>
<label>Notify course owner on new participant registration</label>
<processMetadataValues>
<name>BuilderType</name>
<value>
<stringValue>LightningFlowBuilder</stringValue>
</value>
</processMetadataValues>
<processMetadataValues>
<name>CanvasMode</name>
<value>
<stringValue>AUTO_LAYOUT_CANVAS</stringValue>
</value>
</processMetadataValues>
<processMetadataValues>
<name>OriginBuilderType</name>
<value>
<stringValue>LightningFlowBuilder</stringValue>
</value>
</processMetadataValues>
<processType>AutoLaunchedFlow</processType>
<recordCreates>
<name>create_email_to_course_owner</name>
<label>create email to course owner</label>
<locationX>50</locationX>
<locationY>539</locationY>
<inputAssignments>
<field>HTMLBody__c</field>
<value>
<elementReference>emailbody</elementReference>
</value>
</inputAssignments>
<inputAssignments>
<field>SaveAsActivity__c</field>
<value>
<booleanValue>true</booleanValue>
</value>
</inputAssignments>
<inputAssignments>
<field>Status__c</field>
<value>
<stringValue>Instant</stringValue>
</value>
</inputAssignments>
<inputAssignments>
<field>Subject__c</field>
<value>
<stringValue>Ny påmelding til kurs</stringValue>
</value>
</inputAssignments>
<inputAssignments>
<field>TargetObjectId__c</field>
<value>
<elementReference>$Record.Course__r.OwnerId</elementReference>
</value>
</inputAssignments>
<inputAssignments>
<field>TemplateName__c</field>
<value>
<stringValue>courseNewParticipant</stringValue>
</value>
</inputAssignments>
<inputAssignments>
<field>ToAddress__c</field>
<value>
<elementReference>$Record.Course__r.Owner:User.Email</elementReference>
</value>
</inputAssignments>
<inputAssignments>
<field>WhatId__c</field>
<value>
<elementReference>$Record.Id</elementReference>
</value>
</inputAssignments>
<object>EmailQueue__c</object>
<storeOutputAutomatically>true</storeOutputAutomatically>
</recordCreates>
<recordLookups>
<name>get_course</name>
<label>get course</label>
<locationX>182</locationX>
<locationY>323</locationY>
<assignNullValuesIfNoRecordsFound>false</assignNullValuesIfNoRecordsFound>
<connector>
<targetReference>notify_owner_or_not</targetReference>
</connector>
<filterLogic>and</filterLogic>
<filters>
<field>Id</field>
<operator>EqualTo</operator>
<value>
<elementReference>$Record.Course__c</elementReference>
</value>
</filters>
<getFirstRecordOnly>true</getFirstRecordOnly>
<object>Course__c</object>
<storeOutputAutomatically>true</storeOutputAutomatically>
</recordLookups>
<start>
<locationX>56</locationX>
<locationY>0</locationY>
<connector>
<targetReference>get_course</targetReference>
</connector>
<filterLogic>or</filterLogic>
<filters>
<field>Status__c</field>
<operator>EqualTo</operator>
<value>
<stringValue>Påmeldt</stringValue>
</value>
</filters>
<filters>
<field>Status__c</field>
<operator>EqualTo</operator>
<value>
<stringValue>Venteliste</stringValue>
</value>
</filters>
<object>CourseRegistration__c</object>
<recordTriggerType>Create</recordTriggerType>
<triggerType>RecordAfterSave</triggerType>
</start>
<status>Active</status>
<textTemplates>
<name>emailbody</name>
<isViewedAsPlainText>false</isViewedAsPlainText>
<text>&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
&lt;meta charset=&quot;UTF-8&quot;&gt;
&lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;
&lt;title&gt;&lt;/title&gt;
&lt;style&gt;
body { margin: 0; padding: 0; }
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; width=&quot;100%&quot; bgcolor=&quot;#FFFFFF&quot;&gt;
&lt;tr&gt;
&lt;td align=&quot;center&quot;&gt;
&lt;img src=&quot;https://navdialog.my.salesforce.com/servlet/servlet.ImageServer?id=0152o000005v5nL&amp;oid=00D2o000000aANV&quot; alt=&quot;NAV Logo&quot; width=&quot;134&quot; style=&quot;display:block; margin: 0 auto;&quot;&gt;
&lt;p style=&quot;font-family: &apos;Source Sans Pro&apos;, Tahoma, Verdana, Segoe, sans-serif; font-size: 20px; color: #3e3832; line-height: 1.5; text-align: center;&quot;&gt;En ny deltaker har meldt seg på kurset {!courseName}&lt;/p&gt;
&lt;p style=&quot;font-family: &apos;Source Sans Pro&apos;, Tahoma, Verdana, Segoe, sans-serif; font-size: 14px; color: #3e3832; line-height: 1.5; text-align: center;&quot;&gt;[Dette er en automatisk generert epost. Du får dette varselet fordi du er eier av et kurs og ønsket varsel ved hver påmelding]&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/body&gt;
&lt;/html&gt;</text>
</textTemplates>
<variables>
<name>courseName</name>
<dataType>String</dataType>
<isCollection>false</isCollection>
<isInput>false</isInput>
<isOutput>false</isOutput>
<value>
<elementReference>$Record.Course__r.Name</elementReference>
</value>
</variables>
</Flow>
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@
<behavior>Edit</behavior>
<field>Cancel__c</field>
</layoutItems>
<layoutItems>
<behavior>Edit</behavior>
<field>Notify_me_on_new_participants__c</field>
</layoutItems>
<layoutItems>
<behavior>Edit</behavior>
<field>Type__c</field>
Expand Down Expand Up @@ -241,7 +245,7 @@
<showRunAssignmentRulesCheckbox>false</showRunAssignmentRulesCheckbox>
<showSubmitAndAttachButton>false</showSubmitAndAttachButton>
<summaryLayout>
<masterLabel>00h1j0000024FD8</masterLabel>
<masterLabel>00h5t0000038WZh</masterLabel>
<sizeX>4</sizeX>
<sizeY>0</sizeY>
<summaryLayoutStyle>Default</summaryLayoutStyle>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<CustomFieldTranslation xmlns="http://soap.sforce.com/2006/04/metadata">
<help></help>
<label>Varsle meg ved hver påmelding?</label>
<name>Notify_me_on_new_participants__c</name>
</CustomFieldTranslation>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
<fullName>Notify_me_on_new_participants__c</fullName>
<defaultValue>false</defaultValue>
<externalId>false</externalId>
<inlineHelpText>Velg om du ønsker å bli varslet for hver nye påmelding. Eposten blir sendt til eier av kurset.</inlineHelpText>
<label>Notify me on new participants?</label>
<trackTrending>false</trackTrending>
<type>Checkbox</type>
</CustomField>
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,11 @@
<field>Course__c.IsNew__c</field>
<readable>true</readable>
</fieldPermissions>
<fieldPermissions>
<editable>true</editable>
<field>Course__c.Notify_me_on_new_participants__c</field>
<readable>true</readable>
</fieldPermissions>
<fieldPermissions>
<editable>false</editable>
<field>Course__c.NumberOfParticipants__c</field>
Expand Down

0 comments on commit 0f1f7b2

Please sign in to comment.