| 
									
										
										
										
											2015-06-05 14:15:38 +08:00
										 |  |  | package models | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-06-08 19:39:02 +08:00
										 |  |  | import "errors" | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-11-05 20:07:06 +08:00
										 |  |  | var ErrInvalidEmailCode = errors.New("invalid or expired email code") | 
					
						
							| 
									
										
										
										
											2019-04-23 16:24:47 +08:00
										 |  |  | var ErrSmtpNotEnabled = errors.New("SMTP not configured, check your grafana.ini config file's [smtp] section") | 
					
						
							| 
									
										
										
										
											2015-06-08 19:39:02 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-08-26 22:44:18 +08:00
										 |  |  | // SendEmailAttachFile is a definition of the attached files without path
 | 
					
						
							|  |  |  | type SendEmailAttachFile struct { | 
					
						
							|  |  |  | 	Name    string | 
					
						
							|  |  |  | 	Content []byte | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-07-19 18:31:51 +08:00
										 |  |  | // SendEmailCommand is the command for sending emails
 | 
					
						
							| 
									
										
										
										
											2015-06-05 14:15:38 +08:00
										 |  |  | type SendEmailCommand struct { | 
					
						
							| 
									
										
										
										
											2019-08-26 22:44:18 +08:00
										 |  |  | 	To            []string | 
					
						
							| 
									
										
										
										
											2020-01-10 23:06:33 +08:00
										 |  |  | 	SingleEmail   bool | 
					
						
							| 
									
										
										
										
											2019-08-26 22:44:18 +08:00
										 |  |  | 	Template      string | 
					
						
							|  |  |  | 	Subject       string | 
					
						
							|  |  |  | 	Data          map[string]interface{} | 
					
						
							|  |  |  | 	Info          string | 
					
						
							|  |  |  | 	ReplyTo       []string | 
					
						
							| 
									
										
										
										
											2020-06-01 23:11:25 +08:00
										 |  |  | 	EmbeddedFiles []string | 
					
						
							| 
									
										
										
										
											2019-08-26 22:44:18 +08:00
										 |  |  | 	AttachedFiles []*SendEmailAttachFile | 
					
						
							| 
									
										
										
										
											2015-06-05 14:15:38 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-07-19 18:31:51 +08:00
										 |  |  | // SendEmailCommandSync is the command for sending emails synchronously
 | 
					
						
							| 
									
										
										
										
											2016-10-03 15:38:03 +08:00
										 |  |  | type SendEmailCommandSync struct { | 
					
						
							|  |  |  | 	SendEmailCommand | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | type SendWebhookSync struct { | 
					
						
							| 
									
										
										
										
											2017-03-24 04:53:54 +08:00
										 |  |  | 	Url         string | 
					
						
							|  |  |  | 	User        string | 
					
						
							|  |  |  | 	Password    string | 
					
						
							|  |  |  | 	Body        string | 
					
						
							|  |  |  | 	HttpMethod  string | 
					
						
							|  |  |  | 	HttpHeader  map[string]string | 
					
						
							|  |  |  | 	ContentType string | 
					
						
							| 
									
										
										
										
											2016-10-03 15:38:03 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-06-05 14:15:38 +08:00
										 |  |  | type SendResetPasswordEmailCommand struct { | 
					
						
							| 
									
										
										
										
											2015-06-05 17:08:19 +08:00
										 |  |  | 	User *User | 
					
						
							| 
									
										
										
										
											2015-06-05 14:15:38 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-06-08 19:39:02 +08:00
										 |  |  | type ValidateResetPasswordCodeQuery struct { | 
					
						
							|  |  |  | 	Code   string | 
					
						
							|  |  |  | 	Result *User | 
					
						
							|  |  |  | } |