File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -579,4 +579,39 @@ public static function subscriberMessages($userid=0, $email=''){
579579 }
580580 die (0 );
581581 }
582+
583+ /**
584+ * Insert a new registry to user history
585+ * <p><strong>Parameters (two required):</strong><br/>
586+ * [*email] {string} email of the subscriber<br/>
587+ * [*msg] {string}
588+ * [*detail] {string}
589+ * </p>
590+ * <p><strong>Returns:</strong><br/>
591+ * Nothing
592+ * </p>
593+ */
594+
595+ public static function subscriberAddHistory ()
596+ {
597+ if (!validateEmail ($ _REQUEST ['email ' ])) {
598+ Response::outputErrorMessage ('invalid email address ' );
599+ }
600+
601+ $ msg = filter_var ($ _REQUEST ['msg ' ], FILTER_SANITIZE_STRING );
602+ if (empty ($ msg )) {
603+ Response::outputErrorMessage ('msg is empty ' );
604+ }
605+ $ detail = filter_var ($ _REQUEST ['detail ' ], FILTER_SANITIZE_STRING );
606+
607+
608+ try {
609+ $ response = new Response ();
610+ $ result = addUserHistory ($ _REQUEST ['email ' ], $ msg , $ detail );
611+ $ response ->setData ('messages ' , $ result );
612+ $ response ->output ();
613+ } catch (\Exception $ e ) {
614+ Response::outputError ($ e );
615+ }
616+ }
582617}
You can’t perform that action at this time.
0 commit comments