Skip to content

Commit

Permalink
Fix notif email image and layout
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacsolo committed May 29, 2024
1 parent 1513ca0 commit 8447c49
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -394,12 +394,6 @@ export const BodyStyles = () => {
}
}
@media (max-width: 720px) {
#bodyCell {
text-align: center;
}
}
@media (max-width: 720px) {
.templateContainer {
display: table !important;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,16 +86,12 @@ const DEFAULT_TRACK_COVER_ART_URL = ''
const DEFAULT_PLAYLIST_IMAGE_IRL = ''

const getUserProfileUrl = (user: UserResource) => {
if (!user.creator_node_endpoint) {
return null
}
const contentNodes = user.creator_node_endpoint.split(',')
const primaryEndpoint = contentNodes[0]
let profilePictureUrl = DEFAULT_PROFILE_IMG
const contentNode = getContentNode()
if (user.profile_picture_sizes) {
profilePictureUrl = `${primaryEndpoint}/ipfs/${user.profile_picture_sizes}/1000x1000.jpg`
profilePictureUrl = `${contentNode}/content/${user.profile_picture_sizes}/1000x1000.jpg`
} else if (user.profile_picture) {
profilePictureUrl = `${primaryEndpoint}/ipfs/${user.profile_picture}`
profilePictureUrl = `${contentNode}/content/${user.profile_picture}`
}
return profilePictureUrl
}
Expand Down Expand Up @@ -252,7 +248,7 @@ const getNotificationProps = async (
for (const notification of mappedNotifications) {
const resourcesToFetch = notification.getResourcesForEmail()
Object.entries(resourcesToFetch).forEach(([key, value]) => {
; (value as Set<number>).forEach(
;(value as Set<number>).forEach(
idsToFetch[key as keyof ResourceIds].add,
idsToFetch[key as keyof ResourceIds]
)
Expand All @@ -266,7 +262,7 @@ const getNotificationProps = async (
for (const notification of acc[n]) {
const resourcesToFetch = notification.getResourcesForEmail()
Object.entries(resourcesToFetch).forEach(([key, value]) => {
; (value as Set<number>).forEach(
;(value as Set<number>).forEach(
idsToFetch[key as keyof ResourceIds].add,
idsToFetch[key as keyof ResourceIds]
)
Expand Down Expand Up @@ -310,12 +306,15 @@ const getEmailSubject = (
// they receive the email.
const formattedDayAgo = now.format('MMMM Do YYYY')
const shortWeekAgoFormat = weekAgo.format('MMMM Do')
const liveSubjectFormat = `${notificationCount} unread notification${notificationCount > 1 ? 's' : ''
}`
const weeklySubjectFormat = `${notificationCount} unread notification${notificationCount > 1 ? 's' : ''
} from ${shortWeekAgoFormat} - ${formattedDayAgo}`
const dailySubjectFormat = `${notificationCount} unread notification${notificationCount > 1 ? 's' : ''
} from ${formattedDayAgo}`
const liveSubjectFormat = `${notificationCount} unread notification${
notificationCount > 1 ? 's' : ''
}`
const weeklySubjectFormat = `${notificationCount} unread notification${
notificationCount > 1 ? 's' : ''
} from ${shortWeekAgoFormat} - ${formattedDayAgo}`
const dailySubjectFormat = `${notificationCount} unread notification${
notificationCount > 1 ? 's' : ''
} from ${formattedDayAgo}`

let subject
if (frequency === 'live') {
Expand Down

0 comments on commit 8447c49

Please sign in to comment.