Я использую Java Springboot для внутреннего сервера и HTML для создания шаблонов электронной почты
в свой шаблон я добавил этот пиксель для отслеживания:
Код: Выделить всё
[img]https://localhost:8080/api/v1/images/1[/img]
Код: Выделить всё
@GetMapping("/images/{emailID}")
public ResponseEntity getImagePixel (@Pathvariable String emailID) {
try{
// wait 30seconds before saving the event
Thread.sleep(30000);
// If the connection with the client is lost, throw an exception and ignore the next line
//save tracking only if user spend > 30s
service.saveTracking(emailID);
return ok().contentType(IMAGE_PNG).body(pixel);
} catch (ConnectionLostException){
// catch connection lost error if the client close the email before 30s or if did not receive the response
}
}
Подробнее здесь: https://stackoverflow.com/questions/694 ... ading-time
Мобильная версия