func (h *MailHandler) Handle(request shared.IPathRequest) (shared.IResponse, error) { reportName := "" var id uint64 recipientRaw := "" notes := "" err := request.ScanPath(&reportName, &id, &recipientRaw, ¬es) if err != nil { return nil, err } if notes == "-" { notes = "" } report, err := h.Reporter.GetReportHTMLWriter(reportName, id, request.Session()) if err != nil { return nil, err } err = h.Mailer.SendMailFromResponse(report, recipientRaw, notes) if err != nil { return nil, err } return shared.QuickStringResponse("Email sent to " + recipientRaw), nil }
func (r *Reporter) HandleReportRequest(request shared.IPathRequest) (shared.IResponse, error) { var name string var pk uint64 //var fname string err := request.ScanPath(&name, &pk) //, &fname) if err != nil { return nil, err } return r.GetReportHTMLWriter(name, pk, request.Session()) }
func (h *PDFHandler) Handle(request shared.IPathRequest) (shared.IResponse, error) { reportName := "" var id uint64 var fname string err := request.ScanPath(&reportName, &id, &fname) if err != nil { return nil, err } report, err := h.Reporter.GetReportHTMLWriter(reportName, id, request.Session()) if err != nil { return nil, err } pdfResponse := h.PDFer.ResponseAsPDF(report) return pdfResponse, nil }