-
Type: Improvement
-
Status: Done (View Workflow)
-
Priority: Major
-
Resolution: Completed
-
Affects Version/s: CFA 2021R1
-
Fix Version/s: CFA 2021R1
-
Component/s: ServerManager
-
Labels:
-
Source Code ID(s):
-
Sprint:CFAMX Angular Update Sprint 1
As a Product Owner I want the Query Mailer to be enhanced so that the results of a query can be output directly into the body of the email
Notes
- When chatting with Colin Wyatt-Goodall, we discussed setting a limit of sorts to automagically toggle between putting the content into the body of the email and attaching it. I will leave the decision of breakpoint to development
- On of the things driving this requirement is that the current process requires that the attachment has to be opened everyday, and it will be easier to have some data in the body of the email and apply rules to that content (either in an email app, or some other tool)
Acceptance Criteria
- Confirm that the results of a query will be displayed in the body of the email if the setting is enabled
Confirm that the limit is documented- Confirm that the results of a query will be included in an attachment if set to do so
- Confirm the query mailer automagically sends the results to the body of the email, or as an attachment
Sample Query
DECLARE @dayofweek VARCHAR(100) = datename(dw,getdate()) ; SELECT (CONVERT(DATE, GETDATE()))[Import Date],@dayofweek [Import Day], db_name() [Environment] ; BEGIN IF @dayofweek = 'Saturday' BEGIN SELECT '----------------------------------------------' AS 'Today is Saturday - no Full Forecasts for Sundays' END ELSE BEGIN Select COUNT(1) AS FullForecastsNotImported from tbentityzone ez with(nolock) join tbentity e with(nolock) on ez.entityid = e.entityid where ez.ZoneID = 770 AND e.Status != 'Closed' and e.TempCloseDate is Null AND ez.EntityID not in ( select EntityID from Forecasting.forecast with(nolock) where BusinessDay = CONVERT(VARCHAR(10), getdate()+15, 121) and GenerationDate > CONVERT(VARCHAR(10), getdate(), 121) ) END END ; BEGIN IF @dayofweek = 'Monday' BEGIN SELECT '-------------------------------------------------------' AS 'Today is Monday - no Summary Forecasts for Sundays' END ELSE BEGIN Select COUNT(1) AS SummaryForecastsNotImported from tbentityzone ez with(nolock) join tbentity e with(nolock) on ez.entityid = e.entityid where ez.ZoneID = 770 AND e.Status != 'Closed' and e.TempCloseDate is Null AND ez.EntityID not in ( select EntityID from Forecasting.forecast with(nolock) where BusinessDay = CONVERT(VARCHAR(10), getdate()+20, 121) and GenerationDate > CONVERT(VARCHAR(10), getdate(), 121) ) END END ; SELECT '-----------------------------------------------------------------------------' AS 'Count of Forecasts Proccessed by Business Date' ; SELECT COUNT(1) AS ForecastCount, SUBSTRING(a.AuditDetails, 117, 10) AS BusinessDay FROM tbAudit a WITH (NOLOCK) WHERE a.AuditDateTime >= CONVERT(VARCHAR(10), getdate(), 121) AND a.AuditDateTime < CONVERT(VARCHAR(10), getdate()+1, 121) AND a.AuditCategoryID = 23 AND a.AuditDetails LIKE '%demand%' GROUP BY SUBSTRING(a.AuditDetails, 117, 10) ;
- relates to
-
CFAMX-10369 Forecast Import Dashboard & Notification (Query Mailer)
- Closed